PATH:
home
/
sparklp6
/
public_html
/
website_356c8563
/
wp-content
/
plugins
/
relevanssi
/
lib
/
compatibility
<?php /** * /lib/compatibility/ninjatables.php * * Ninja Tables compatibility features. * * @package Relevanssi * @author Mikko Saari * @license https://wordpress.org/about/gpl/ GNU General Public License * @see https://www.relevanssi.com/ */ add_filter( 'relevanssi_post_content', 'relevanssi_index_ninja_tables' ); /** * Indexes Ninja Tables table contents. * * Uses regular expression matching to find all the Ninja Tables shortcodes in * the post content and then uses relevanssi_index_ninja_table() to convert the * tables into strings. * * @global $wpdb WordPress database abstraction. * @see relevanssi_index_ninja_table() * * @param string $content The post content. * * @return string Post content with the Ninja Tables data. */ function relevanssi_index_ninja_tables( $content ) { $m = preg_match_all( '/.*\[ninja_tables.*?id=["\'](\d+)["\'].*?\]/im', $content, $matches, PREG_PATTERN_ORDER ); if ( ! $m ) { return $content; } foreach ( $matches[1] as $table_id ) { $content .= ' ' . relevanssi_index_ninja_table( $table_id ); } return $content; } /** * Creates a string containing a Ninja Table table contents. * * The string contains the caption and the values from each row. The table * title and description are also included, if they are set visible on the * frontend. * * @global $wpdb WordPress database abstraction. * * @param int $table_id The table ID. * * @return string The table content as a string. */ function relevanssi_index_ninja_table( $table_id ) { global $wpdb; $table_post = get_post( $table_id ); $table_settings = get_post_meta( $table_id, '_ninja_table_settings', true ); $table_contents = ''; if ( isset( $table_settings['show_description'] ) && '1' === $table_settings['show_description'] ) { $table_contents .= ' ' . $table_post->post_content; } if ( isset( $table_settings['show_title'] ) && '1' === $table_settings['show_title'] ) { $table_contents .= ' ' . $table_post->post_title; } $table_contents .= ' ' . get_post_meta( $table_id, '_ninja_table_caption', true ); $rows = $wpdb->get_results( $wpdb->prepare( "SELECT value FROM {$wpdb->prefix}ninja_table_items WHERE table_id=%d", $table_id ) ); foreach ( $rows as $row ) { if ( empty( $row->value ) ) { continue; } $json_decoded = json_decode( $row->value ); if ( ! is_object( $json_decoded ) ) { continue; } $array_values = array_map( function ( $value ) { if ( is_object( $value ) ) { return ''; } return strval( $value ); }, array_values( get_object_vars( $json_decoded ) ) ); $table_contents .= ' ' . implode( ' ', $array_values ); } return $table_contents; }
[-] multilingualpress.php
[edit]
[-] jetsmartfilters.php
[edit]
[-] bricks.php
[edit]
[-] wp-members.php
[edit]
[-] tablepress.php
[edit]
[-] pretty-links.php
[edit]
[-] members.php
[edit]
[-] .htaccess
[edit]
[-] gutenberg.php
[edit]
[-] aioseo.php
[edit]
[-] groups.php
[edit]
[-] woocommerce.php
[edit]
[-] oxygen.php
[edit]
[-] paidmembershippro.php
[edit]
[-] wpml.php
[edit]
[-] ninjatables.php
[edit]
[-] avada.php
[edit]
[-] useraccessmanager.php
[edit]
[-] seopress.php
[edit]
[-] fibosearch.php
[edit]
[-] yoast-seo.php
[edit]
[-] elementor.php
[edit]
[-] seoframework.php
[edit]
[-] wp-file-download.php
[edit]
[-] wp-search-suggest.php
[edit]
[-] acf.php
[edit]
[-] wpjvpostreadinggroups.php
[edit]
[-] product-gtin-ean-upc-isbn-for-woocommerce.php
[edit]
[-] memberpress.php
[edit]
[-] polylang.php
[edit]
[-] restrictcontentpro.php
[edit]
[-] simplemembership.php
[edit]
[+]
..
[-] rankmath.php
[edit]