當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TablePress::model_options方法代碼示例

本文整理匯總了PHP中TablePress::model_options方法的典型用法代碼示例。如果您正苦於以下問題:PHP TablePress::model_options方法的具體用法?PHP TablePress::model_options怎麽用?PHP TablePress::model_options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TablePress的用法示例。


在下文中一共展示了TablePress::model_options方法的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_options方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。