当前位置: 首页>>代码示例>>PHP>>正文


PHP TablePress::load_controller方法代码示例

本文整理汇总了PHP中TablePress::load_controller方法的典型用法代码示例。如果您正苦于以下问题:PHP TablePress::load_controller方法的具体用法?PHP TablePress::load_controller怎么用?PHP TablePress::load_controller使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TablePress的用法示例。


在下文中一共展示了TablePress::load_controller方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load_tablepress_in_the_admin

function load_tablepress_in_the_admin()
{
    if (is_admin() && defined('DOING_AJAX') && DOING_AJAX) {
        TablePress::load_controller('frontend');
        // работает на дефолтной теме
        // TablePress::$controller = TablePress::load_controller( 'admin_ajax' );
    }
}
开发者ID:jetfire21,项目名称:mod-box,代码行数:8,代码来源:functions.php

示例2: tokenizeContent

 /**
  * Generates the content tokens and puts them into the tokens array
  *
  * @param object $the_post the post object
  * @param array $tokens tokens array
  *
  * @return int keywords count
  */
 private function tokenizeContent($the_post, &$tokens)
 {
     $args = $this->args;
     $content = $the_post->post_content;
     if ($args['extract_shortcodes']) {
         // WP Table Reloaded support
         if (defined('WP_TABLE_RELOADED_ABSPATH')) {
             include_once WP_TABLE_RELOADED_ABSPATH . 'controllers/controller-frontend.php';
             $wpt_reloaded = new WP_Table_Reloaded_Controller_Frontend();
         }
         // TablePress support
         if (defined('TABLEPRESS_ABSPATH')) {
             $tp_controller = TablePress::load_controller('frontend');
             $tp_controller->init_shortcodes();
         }
         // Remove user defined shortcodes
         $shortcodes = explode(',', $args['exclude_shortcodes']);
         foreach ($shortcodes as $shortcode) {
             remove_shortcode(trim($shortcode));
             add_shortcode(trim($shortcode), array($this, 'return_empty_string'));
         }
         // Remove some shortcodes
         remove_shortcode('wpdreams_ajaxsearchpro');
         add_shortcode('wpdreams_ajaxsearchpro', array($this, 'return_empty_string'));
         remove_shortcode('wpdreams_ajaxsearchpro_results');
         add_shortcode('wpdreams_ajaxsearchpro_results', array($this, 'return_empty_string'));
         remove_shortcode('wpdreams_asp_settings');
         add_shortcode('wpdreams_asp_settings', array($this, 'return_empty_string'));
         remove_shortcode('contact-form');
         add_shortcode('contact-form', array($this, 'return_empty_string'));
         remove_shortcode('starrater');
         add_shortcode('starrater', array($this, 'return_empty_string'));
         remove_shortcode('responsive-flipbook');
         add_shortcode('responsive-flipbook', array($this, 'return_empty_string'));
         remove_shortcode('avatar_upload');
         add_shortcode('avatar_upload', array($this, 'return_empty_string'));
         remove_shortcode('product_categories');
         add_shortcode('product_categories', array($this, 'return_empty_string'));
         remove_shortcode('recent_products');
         add_shortcode('recent_products', array($this, 'return_empty_string'));
         $content = do_shortcode($content);
         // WP 4.2 emoji strip
         if (function_exists('wp_encode_emoji')) {
             $content = wp_encode_emoji($content);
         }
         if (defined('TABLEPRESS_ABSPATH')) {
             unset($tp_controller);
         }
         if (defined('WP_TABLE_RELOADED_ABSPATH')) {
             unset($wpt_reloaded);
         }
     }
     // Strip the remaining shortcodes
     $content = strip_shortcodes($content);
     $content = preg_replace('/<[a-zA-Z\\/][^>]*>/', ' ', $content);
     $content = strip_tags($content);
     $filtered_content = apply_filters('asp_post_content_before_tokenize', $content);
     if ($filtered_content == "") {
         return 0;
     }
     $content_keywords = $this->tokenize($filtered_content);
     foreach ($content_keywords as $keyword) {
         $this->insertToken($tokens, $keyword[0], $keyword[1], 'content');
     }
     return count($content_keywords);
 }
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:74,代码来源:indextable.class.php

示例3: relevanssi_index_doc


//.........这里部分代码省略.........
        $insert_data = relevanssi_index_mysql_columns($insert_data, $post->ID);
    }
    $index_titles = true;
    if (apply_filters('relevanssi_index_titles', $index_titles)) {
        $filtered_title = apply_filters('relevanssi_post_title_before_tokenize', $post->post_title, $post);
        $titles = relevanssi_tokenize(apply_filters('the_title', $filtered_title));
        if (count($titles) > 0) {
            foreach ($titles as $title => $count) {
                $n++;
                isset($insert_data[$title]['title']) ? $insert_data[$title]['title'] += $count : ($insert_data[$title]['title'] = $count);
            }
        }
    }
    $index_content = true;
    if (apply_filters('relevanssi_index_content', $index_content)) {
        remove_shortcode('noindex');
        add_shortcode('noindex', 'relevanssi_noindex_shortcode_indexing');
        $contents = apply_filters('relevanssi_post_content', $post->post_content, $post);
        // Allow user to add extra content for Relevanssi to index
        // Thanks to Alexander Gieg
        $additional_content = trim(apply_filters('relevanssi_content_to_index', '', $post));
        if ('' != $additional_content) {
            $contents .= ' ' . $additional_content;
        }
        if ('on' == get_option('relevanssi_expand_shortcodes')) {
            if (function_exists("do_shortcode")) {
                // WP Table Reloaded support
                if (defined('WP_TABLE_RELOADED_ABSPATH')) {
                    include_once WP_TABLE_RELOADED_ABSPATH . 'controllers/controller-frontend.php';
                    $My_WP_Table_Reloaded = new WP_Table_Reloaded_Controller_Frontend();
                }
                // TablePress support
                if (defined('TABLEPRESS_ABSPATH')) {
                    $My_TablePress_Controller = TablePress::load_controller('frontend');
                    $My_TablePress_Controller->init_shortcodes();
                }
                $disable_shortcodes = get_option('relevanssi_disable_shortcodes');
                $shortcodes = explode(',', $disable_shortcodes);
                foreach ($shortcodes as $shortcode) {
                    remove_shortcode(trim($shortcode));
                }
                remove_shortcode('contact-form');
                // Jetpack Contact Form causes an error message
                remove_shortcode('starrater');
                // GD Star Rating rater shortcode causes problems
                remove_shortcode('responsive-flipbook');
                // Responsive Flipbook causes problems
                remove_shortcode('avatar_upload');
                // WP User Avatar is incompatible
                remove_shortcode('product_categories');
                // A problematic WooCommerce shortcode
                remove_shortcode('recent_products');
                // A problematic WooCommerce shortcode
                remove_shortcode('php');
                // PHP Code for Posts
                $post_before_shortcode = $post;
                $contents = do_shortcode($contents);
                $post = $post_before_shortcode;
                if (defined('TABLEPRESS_ABSPATH')) {
                    unset($My_TablePress_Controller);
                }
                if (defined('WP_TABLE_RELOADED_ABSPATH')) {
                    unset($My_WP_Table_Reloaded);
                }
            }
        } else {
开发者ID:WP-Panda,项目名称:allergenics,代码行数:67,代码来源:indexing.php


注:本文中的TablePress::load_controller方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。