本文整理汇总了PHP中set_screen_options函数的典型用法代码示例。如果您正苦于以下问题:PHP set_screen_options函数的具体用法?PHP set_screen_options怎么用?PHP set_screen_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_screen_options函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
* Construct the parent class.
* @access public
*/
public function load()
{
global $status, $page;
parent::__construct(array('singular' => 'activity', 'plural' => 'activity', 'ajax' => true));
add_screen_option('per_page', array('default' => 15, 'label' => __('Events per page', 'revisr'), 'option' => 'edit_revisr_events_per_page'));
set_screen_options();
}
示例2: load
/**
* Construct the parent class.
* @access public
*/
public function load()
{
global $status, $page;
parent::__construct(array('singular' => 'repository', 'plural' => 'repositories'));
add_screen_option('per_page', array('default' => 10, 'label' => __('Repositories per page', 'revisr'), 'option' => 'edit_revisr_repositories_per_page'));
set_screen_options();
}
示例3: admin_load
/**
* Settings Page
* Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
*/
static function admin_load()
{
add_screen_option('per_page', array('label' => __('Per Page'), 'default' => 20));
add_filter('set-screen-option', array(__CLASS__, 'set_screen_option'), 10, 3);
// hack for core limitation: see http://core.trac.wordpress.org/ticket/18954
set_screen_options();
add_settings_section('usage', __('Scripts n Styles Usage', 'scripts-n-styles'), array(__CLASS__, 'usage_section'), SnS_Admin::MENU_SLUG);
}
示例4: __construct
public function __construct($args = array())
{
parent::__construct(array('singular' => 'activity', 'screen' => isset($args['screen']) ? $args['screen'] : null));
$this->_roles = apply_filters('aal_init_roles', array('manage_options' => array('Core', 'Export', 'Post', 'Taxonomy', 'User', 'Options', 'Attachment', 'Plugin', 'Widget', 'Theme', 'Menu', 'Comments'), 'edit_pages' => array('Post', 'Taxonomy', 'Attachment', 'Comments')));
$this->_caps = apply_filters('aal_init_caps', array('administrator' => array('administrator', 'editor', 'author', 'guest'), 'editor' => array('editor', 'author', 'guest'), 'author' => array('author', 'guest')));
add_screen_option('per_page', array('default' => 50, 'label' => __('Activities', 'aryo-activity-log'), 'option' => 'edit_aal_logs_per_page'));
add_filter('set-screen-option', array(&$this, 'set_screen_option'), 10, 3);
set_screen_options();
}
示例5: __construct
function __construct($args = array())
{
$screen_id = isset($args['screen']) ? $args['screen'] : null;
$screen_id = apply_filters('wp_stream_list_table_screen_id', $screen_id);
parent::__construct(array('post_type' => 'stream', 'plural' => 'records', 'screen' => $screen_id));
add_screen_option('per_page', array('default' => 20, 'label' => __('Records per page', 'stream'), 'option' => 'edit_stream_per_page'));
// Check for default hidden columns
$this->get_hidden_columns();
add_filter('screen_settings', array($this, 'screen_controls'), 10, 2);
add_filter('set-screen-option', array(__CLASS__, 'set_screen_option'), 10, 3);
set_screen_options();
}
示例6: __construct
function __construct($args = array())
{
$view = wp_stream_filter_input(INPUT_GET, 'view');
parent::__construct(array('post_type' => 'stream_notifications', 'plural' => 'rules', 'screen' => isset($args['screen']) ? $args['screen'] : null));
if (null === $view) {
add_screen_option('per_page', array('default' => 20, 'label' => esc_html__('Rules per page', 'stream-notifications'), 'option' => 'edit_stream_notifications_per_page'));
}
add_filter('set-screen-option', array(__CLASS__, 'set_screen_option'), 10, 3);
add_filter('wp_stream_query_args', array(__CLASS__, 'register_occurrences_for_sorting'));
add_filter('wp_stream_query', array(__CLASS__, 'include_null_occurrences'), 10, 2);
set_screen_options();
}
示例7: wp_remote_get
require_once ABSPATH . WPINC . '/http.php';
$response = wp_remote_get(admin_url('upgrade.php?step=1'), array('timeout' => 120, 'httpversion' => '1.1'));
/** This action is documented in wp-admin/network/upgrade.php */
do_action('after_mu_upgrade', $response);
unset($response);
}
unset($c);
}
}
require_once ABSPATH . 'wp-admin/includes/admin.php';
auth_redirect();
// Schedule trash collection
if (!wp_next_scheduled('wp_scheduled_delete') && !wp_installing()) {
wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
}
set_screen_options();
$date_format = __('F j, Y');
$time_format = __('g:i a');
wp_enqueue_script('common');
/**
* $pagenow is set in vars.php
* $wp_importers is sometimes set in wp-admin/includes/import.php
* The remaining variables are imported as globals elsewhere, declared as globals here
*
* @global string $pagenow
* @global array $wp_importers
* @global string $hook_suffix
* @global string $plugin_page
* @global string $typenow
* @global string $taxnow
*/
示例8: setScreenOptions
/**
* Saves option for number of rows when listing posts, pages, comments, etc.
*
* @since 2.8.0
*
* @return WpTesting_WordPressFacade
*/
public function setScreenOptions()
{
set_screen_options();
return $this;
}