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


PHP TablePress::model_table方法代码示例

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


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

示例1: run

 /**
  * Start-up TablePress (run on WordPress "init") and load the controller for the current state
  *
  * @since 1.0.0
  * @uses load_controller()
  */
 public static function run()
 {
     /**
      * Fires when TablePress is loaded.
      *
      * @since 1.0.0
      */
     do_action('tablepress_run');
     // exit early if TablePress doesn't have to be loaded
     if ('wp-login.php' === basename($_SERVER['SCRIPT_FILENAME']) || defined('XMLRPC_REQUEST') && XMLRPC_REQUEST || defined('DOING_CRON') && DOING_CRON) {
         return;
     }
     // check if minimum requirements are fulfilled, currently WordPress 3.8
     if (version_compare(str_replace('-src', '', $GLOBALS['wp_version']), '3.8', '<')) {
         // show error notice to admins, if WP is not installed in the minimum required version, in which case TablePress will not work
         if (current_user_can('update_plugins')) {
             add_action('admin_notices', array('TablePress', 'show_minimum_requirements_error_notice'));
         }
         // and exit TablePress
         return;
     }
     /**
      * Filter the string that is used as the [table] Shortcode.
      *
      * @since 1.0.0
      *
      * @param string $shortcode The [table] Shortcode string.
      */
     self::$shortcode = apply_filters('tablepress_table_shortcode', self::$shortcode);
     /**
      * Filter the string that is used as the [table-info] Shortcode.
      *
      * @since 1.0.0
      *
      * @param string $shortcode_info The [table-info] Shortcode string.
      */
     self::$shortcode_info = apply_filters('tablepress_table_info_shortcode', self::$shortcode_info);
     // Load modals for table and options, to be accessible from everywhere via `TablePress::$model_options` and `TablePress::$model_table`
     self::$model_options = self::load_model('options');
     self::$model_table = self::load_model('table');
     if (is_admin()) {
         $controller = 'admin';
         if (defined('DOING_AJAX') && DOING_AJAX) {
             $controller .= '_ajax';
         }
     } else {
         $controller = 'frontend';
     }
     self::$controller = self::load_controller($controller);
 }
开发者ID:heyjones,项目名称:crossfitpurpose,代码行数:56,代码来源:class-tablepress.php


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