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


PHP add_screen_options_panel函数代码示例

本文整理汇总了PHP中add_screen_options_panel函数的典型用法代码示例。如果您正苦于以下问题:PHP add_screen_options_panel函数的具体用法?PHP add_screen_options_panel怎么用?PHP add_screen_options_panel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: init

 /**
  * Initialize all of our methods and such. Only runs if the module is active
  *
  * @uses add_action()
  */
 function init()
 {
     // .ics calendar subscriptions
     add_action('wp_ajax_ef_calendar_ics_subscription', array($this, 'handle_ics_subscription'));
     add_action('wp_ajax_nopriv_ef_calendar_ics_subscription', array($this, 'handle_ics_subscription'));
     // Check whether the user should have the ability to view the calendar
     $view_calendar_cap = 'ef_view_calendar';
     $view_calendar_cap = apply_filters('ef_view_calendar_cap', $view_calendar_cap);
     if (!current_user_can($view_calendar_cap)) {
         return false;
     }
     // Define the create-post capability
     $this->create_post_cap = apply_filters('ef_calendar_create_post_cap', 'edit_posts');
     require_once EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php';
     add_screen_options_panel(self::usermeta_key_prefix . 'screen_options', __('Calendar Options', 'edit-flow'), array($this, 'generate_screen_options'), self::screen_id, false, true);
     add_action('admin_init', array($this, 'handle_save_screen_options'));
     add_action('admin_init', array($this, 'register_settings'));
     add_action('admin_menu', array($this, 'action_admin_menu'));
     add_action('admin_print_styles', array($this, 'add_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // Ajax manipulation for the calendar
     add_action('wp_ajax_ef_calendar_drag_and_drop', array($this, 'handle_ajax_drag_and_drop'));
     // Ajax insert post placeholder for a specific date
     add_action('wp_ajax_ef_insert_post', array($this, 'handle_ajax_insert_post'));
     //Update metadata
     add_action('wp_ajax_ef_calendar_update_metadata', array($this, 'handle_ajax_update_metadata'));
     // Clear li cache for a post when post cache is cleared
     add_action('clean_post_cache', array($this, 'action_clean_li_html_cache'));
     // Action to regenerate the calendar feed sekret
     add_action('admin_init', array($this, 'handle_regenerate_calendar_feed_secret'));
     // Hacks to fix deficiencies in core
     add_action('pre_post_update', array($this, 'fix_post_date_on_update_part_one'), 10, 2);
     add_action('post_updated', array($this, 'fix_post_date_on_update_part_two'), 10, 3);
 }
开发者ID:philoserf,项目名称:Edit-Flow,代码行数:39,代码来源:calendar.php

示例2: onWpInit

 public function onWpInit()
 {
     // parent::onWpInit();
     // custom (raw) screen options for tools page
     add_screen_options_panel('wpla_setting_options', '', array(&$this, 'renderSettingsOptions'), 'wp-lister_page_wpla-tools');
     // load styles and scripts for this page only
     // add_action( 'admin_print_styles', array( &$this, 'onWpPrintStyles' ) );
     add_action('admin_enqueue_scripts', array(&$this, 'onWpEnqueueScripts'));
     add_thickbox();
 }
开发者ID:imranshuvo,项目名称:wp-lister-for-amazon,代码行数:10,代码来源:ToolsPage.php

示例3: onWpInit

 public function onWpInit()
 {
     // parent::onWpInit();
     // custom (raw) screen options for settings page
     add_screen_options_panel('wpla_setting_options', '', array(&$this, 'renderSettingsOptions'), 'wp-lister_page_wpla-settings');
     // Add custom screen options
     $load_action = "load-" . $this->main_admin_menu_slug . "_page_wpla-" . self::slug;
     add_action($load_action, array(&$this, 'addScreenOptions'));
     // network admin page
     add_action('network_admin_menu', array(&$this, 'onWpAdminMenu'));
 }
开发者ID:imranshuvo,项目名称:wp-lister-for-amazon,代码行数:11,代码来源:SettingsPage.php

示例4: onWpInit

 public function onWpInit()
 {
     // parent::onWpInit();
     // custom (raw) screen options for settings page
     add_screen_options_panel('wplister_setting_options', '', array(&$this, 'renderSettingsOptions'), $this->main_admin_menu_slug . '_page_wplister-settings');
     // Add custom screen options
     $load_action = "load-" . $this->main_admin_menu_slug . "_page_wplister-" . self::slug;
     add_action($load_action, array(&$this, 'addScreenOptions'));
     // add screen option on categories page if enabled
     if (get_option('wplister_enable_categories_page')) {
         add_action($load_action . '-categories', array(&$this, 'addScreenOptions'));
     }
     // network admin page
     add_action('network_admin_menu', array(&$this, 'onWpAdminMenu'));
 }
开发者ID:booklein,项目名称:wpbookle,代码行数:15,代码来源:SettingsPage.php

示例5: init

 /**
  * Initialize all of our methods and such. Only runs if the module is active
  *
  * @uses add_action()
  */
 function init()
 {
     // Check whether the user should have the ability to view the calendar
     $view_calendar_cap = 'ef_view_calendar';
     $view_calendar_cap = apply_filters('ef_view_calendar_cap', $view_calendar_cap);
     if (!current_user_can($view_calendar_cap)) {
         return false;
     }
     require_once EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php';
     add_screen_options_panel(self::usermeta_key_prefix . 'screen_options', __('Calendar Options', 'edit-flow'), array($this, 'generate_screen_options'), self::screen_id, false, true);
     add_action('admin_init', array($this, 'handle_save_screen_options'));
     add_action('admin_init', array($this, 'register_settings'));
     add_action('admin_menu', array($this, 'action_admin_menu'));
     add_action('admin_print_styles', array($this, 'add_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // Ajax manipulation for the calendar
     add_action('wp_ajax_ef_calendar_drag_and_drop', array($this, 'handle_ajax_drag_and_drop'));
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:23,代码来源:calendar.php

示例6: wsBrokenLinkChecker

 /**
  * wsBrokenLinkChecker::wsBrokenLinkChecker()
  * Class constructor
  *
  * @param string $loader The fully qualified filename of the loader script that WP identifies as the "main" plugin file.
  * @param blcConfigurationManager $conf An instance of the configuration manager
  * @return void
  */
 function wsBrokenLinkChecker($loader, $conf)
 {
     $this->db_version = BLC_DATABASE_VERSION;
     $this->conf = $conf;
     $this->loader = $loader;
     $this->my_basename = plugin_basename($this->loader);
     $this->load_language();
     //Unlike the activation hook, the deactivation callback *can* be registered in this file
     //because deactivation happens after this class has already been instantiated (durinng the
     //'init' action).
     register_deactivation_hook($loader, array($this, 'deactivation'));
     add_action('admin_menu', array($this, 'admin_menu'));
     //Load jQuery on Dashboard pages (probably redundant as WP already does that)
     add_action('admin_print_scripts', array($this, 'admin_print_scripts'));
     //The dashboard widget
     add_action('wp_dashboard_setup', array($this, 'hook_wp_dashboard_setup'));
     //AJAXy hooks
     add_action('wp_ajax_blc_full_status', array($this, 'ajax_full_status'));
     add_action('wp_ajax_blc_dashboard_status', array($this, 'ajax_dashboard_status'));
     add_action('wp_ajax_blc_work', array($this, 'ajax_work'));
     add_action('wp_ajax_blc_discard', array($this, 'ajax_discard'));
     add_action('wp_ajax_blc_edit', array($this, 'ajax_edit'));
     add_action('wp_ajax_blc_link_details', array($this, 'ajax_link_details'));
     add_action('wp_ajax_blc_unlink', array($this, 'ajax_unlink'));
     add_action('wp_ajax_blc_recheck', array($this, 'ajax_recheck'));
     add_action('wp_ajax_blc_deredirect', array($this, 'ajax_deredirect'));
     add_action('wp_ajax_blc_current_load', array($this, 'ajax_current_load'));
     add_action('wp_ajax_blc_dismiss', array($this, 'ajax_dismiss'));
     add_action('wp_ajax_blc_undismiss', array($this, 'ajax_undismiss'));
     //Add/remove Cron events
     $this->setup_cron_events();
     //Set hooks that listen for our Cron actions
     add_action('blc_cron_email_notifications', array($this, 'maybe_send_email_notifications'));
     add_action('blc_cron_check_links', array($this, 'cron_check_links'));
     add_action('blc_cron_database_maintenance', array($this, 'database_maintenance'));
     add_action('blc_cron_check_news', array($this, 'check_news'));
     //Set the footer hook that will call the worker function via AJAX.
     add_action('admin_footer', array($this, 'admin_footer'));
     //Add a "Screen Options" panel to the "Broken Links" page
     add_screen_options_panel('blc-screen-options', '', array($this, 'screen_options_html'), 'tools_page_view-broken-links', array($this, 'ajax_save_screen_options'), true);
     //Display an explanatory note on the "Tools -> Broken Links -> Warnings" page.
     add_action('admin_notices', array($this, 'show_warnings_section_notice'));
 }
开发者ID:TrueSQN,项目名称:truesqncom,代码行数:51,代码来源:core.php

示例7: addScreenOptions

 function addScreenOptions()
 {
     if (isset($_GET['tab']) && $_GET['tab'] != 'repricing') {
         return;
     }
     if (isset($_GET['action']) && $_GET['action'] == 'edit') {
         // on edit page render developers options
         add_screen_options_panel('wpla_developer_options', '', array(&$this, 'renderDeveloperOptions'), 'toplevel_page_wpla');
     } else {
         // render table options
         $option = 'per_page';
         $args = array('label' => 'Listings', 'default' => 20, 'option' => 'listings_per_page');
         add_screen_option($option, $args);
         $this->repricingTable = new WPLA_RepricingTable();
     }
     // add_thickbox();
     // wp_enqueue_script( 'thickbox' );
     // wp_enqueue_style( 'thickbox' );
 }
开发者ID:imranshuvo,项目名称:wp-lister-for-amazon,代码行数:19,代码来源:RepricingPage.php

示例8: addScreenOptions

 function addScreenOptions()
 {
     if (isset($_GET['action']) && $_GET['action'] == 'edit') {
         // on edit page render developers options
         add_screen_options_panel('wpla_developer_options', '', array(&$this, 'renderDeveloperOptions'), 'toplevel_page_wpla');
     } else {
         // render table options
         $option = 'per_page';
         $args = array('label' => 'Listings', 'default' => 20, 'option' => 'listings_per_page');
         add_screen_option($option, $args);
         $this->listingsTable = new WPLA_ListingsTable();
     }
     // add_thickbox();
     wp_enqueue_script('thickbox');
     wp_enqueue_style('thickbox');
     // enqueue ProfileSelector
     wp_register_script('wpla_profile_selector', self::$PLUGIN_URL . '/js/classes/ProfileSelector.js?ver=' . time(), array('jquery'));
     wp_enqueue_script('wpla_profile_selector');
 }
开发者ID:imranshuvo,项目名称:wp-lister-for-amazon,代码行数:19,代码来源:ListingsPage.php

示例9: init

 /**
  * Initialize the rest of the stuff in the class if the module is active
  */
 function init()
 {
     $view_story_budget_cap = apply_filters('ef_view_story_budget_cap', 'ef_view_story_budget');
     if (!current_user_can($view_story_budget_cap)) {
         return;
     }
     $this->num_columns = $this->get_num_columns();
     $this->max_num_columns = apply_filters('ef_story_budget_max_num_columns', 3);
     // Filter to allow users to pick a taxonomy other than 'category' for sorting their posts
     $this->taxonomy_used = apply_filters('ef_story_budget_taxonomy_used', $this->taxonomy_used);
     add_action('admin_init', array($this, 'handle_form_date_range_change'));
     include_once EDIT_FLOW_ROOT . '/common/php/' . 'screen-options.php';
     if (function_exists('add_screen_options_panel')) {
         add_screen_options_panel(self::usermeta_key_prefix . 'screen_columns', __('Screen Layout', 'edit-flow'), array($this, 'print_column_prefs'), self::screen_id, array($this, 'save_column_prefs'), true);
     }
     // Register the columns of data appearing on every term. This is hooked into admin_init
     // so other Edit Flow modules can register their filters if needed
     add_action('admin_init', array($this, 'register_term_columns'));
     add_action('admin_menu', array($this, 'action_admin_menu'));
     // Load necessary scripts and stylesheets
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     add_action('admin_enqueue_scripts', array($this, 'action_enqueue_admin_styles'));
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:26,代码来源:story-budget.php

示例10: rawhtml_get_settings_fields

    }
    // OK, we're authenticated: we need to find and save the data
    $fields = rawhtml_get_settings_fields();
    $new_settings = array();
    foreach ($fields as $field) {
        if (!empty($_POST['rawhtml_' . $field])) {
            $new_settings[$field] = true;
        } else {
            $new_settings[$field] = false;
        }
    }
    rawhtml_save_post_settings($post_id, $new_settings);
    return true;
}
//Add our panel to the "Screen Options" box
add_screen_options_panel('rawhtml-default-settings', 'Raw HTML defaults', 'rawhtml_default_settings_panel', array('post', 'page'), 'rawhtml_save_new_defaults', true);
/**
 * Retrieve the "disable_*" flags associated with a post.
 * If no flags have been set, this function will return the default settings.
 *
 * Note: Will transparently upgrade the old one-meta-key-per-flag storage system
 * to the new one-key-per-post one.
 *
 * @param int $post_id
 * @return array Flag values as an associative array.
 */
function rawhtml_get_post_settings($post_id)
{
    $defaults = rawhtml_get_default_settings();
    $fields = rawhtml_get_settings_fields();
    //Per-post settings should be stored as a comma-separated list of 1/0 flags.
开发者ID:10Dimensional,项目名称:InspOrg,代码行数:31,代码来源:formatting-override.php

示例11: screenOptionsPanel

 /**
  * Adds the "Show on screen" option to limit number of entries per page on the Connections : Manage admin page.
  *
  * @access private
  * @since  0.8.14
  * @static
  * @uses   get_object_vars()
  * @uses   current_user_can()
  * @uses   add_screen_options_panel()
  * @param  object $screen An instance of the WordPress screen object.
  * @return void
  */
 public static function screenOptionsPanel($screen)
 {
     // Grab an instance of the Connections object.
     $instance = Connections_Directory();
     /*
      * In instances such as WP AJAX requests the add_menu() and add_sub_menu() functions are
      * not run in the admin_menu action, so the properties would not exist and will throw
      * PHP notices when attempting to access them. If the menus have been added then the
      * properties will exist so it will be safe to add the actions using the properties.
      */
     if (get_object_vars($instance->pageHook) && current_user_can('connections_view_menu')) {
         /*
          * The Screen Layout options in the Screen Option tab only needs to be added on the manage page when NOT performing an action to an entry.
          * This is to prevent the Screen Layout options in the Screen Option tab on the Manage
          * admin page when performing an action on an entry.
          */
         if ($screen->id == $instance->pageHook->manage && !isset($_GET['cn-action'])) {
             /*
              * Include the Screen Options class by Janis Elsts
              * http://w-shadow.com/blog/2010/06/29/adding-stuff-to-wordpress-screen-options/
              */
             include_once CN_PATH . 'vendor/screen-options/screen-options.php';
             /*
              * Add the panel to the "Screen Options" box to the manage page.
              * NOTE: This relies on the the Screen Options class by Janis Elsts
              */
             add_screen_options_panel('cn-manage-page-limit', 'Show on screen', array(__CLASS__, 'managePageLimit'), $instance->pageHook->manage);
         }
     }
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:42,代码来源:class.functions.php


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