• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP WP_Screen类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

 public function __construct($args = array())
 {
     $screen = WP_Screen::get(Tribe__Events__Aggregator__Records::$post_type);
     $default = array('screen' => $screen, 'tab' => Tribe__Events__Aggregator__Tabs::instance()->get_active());
     $args = wp_parse_args($args, $default);
     parent::__construct($args);
     // Set Current Tab
     $this->tab = $args['tab'];
     // Set page Instance
     $this->page = Tribe__Events__Aggregator__Page::instance();
     // Set current user
     $this->user = wp_get_current_user();
 }
开发者ID:TakenCdosG,项目名称:chefs,代码行数:13,代码来源:List_Table.php


示例2: render_help

 /**
  * This function adds help tabs and a help sidebar to a screen.
  *
  * @since 0.5.0
  * @param WP_Screen $screen the screen to add the help data to
  * @param array $data help tabs and sidebar (if specified)
  */
 public static function render_help($screen, $data)
 {
     foreach ($data['tabs'] as $slug => $tab) {
         $args = array_merge(array('id' => $slug), $tab);
         $screen->add_help_tab($args);
     }
     if (!empty($data['sidebar'])) {
         $screen->set_help_sidebar($data['sidebar']);
     }
 }
开发者ID:felixarntz,项目名称:options-definitely,代码行数:17,代码来源:Utility.php


示例3: screenOption

 /**
  * Screen option value.
  *
  * @since 141111 First documented version.
  *
  * @param \WP_Screen $screen  A screen object instance.
  * @param string     $option  The screen option to get.
  * @param int        $user_id A specific user ID. Defaults to `NULL`.
  *                            A `NULL` value indicates the current user.
  *
  * @return mixed The screen option value; only if not empty; and only it has a valid data type.
  *               If empty, or not the same data type as the default value; returns the default value.
  */
 public function screenOption(\WP_Screen $screen, $option, $user_id = null)
 {
     $user_id = $this->issetOr($user_id, (int) get_current_user_id(), 'integer');
     $value = get_user_meta($user_id, $screen->get_option($option, 'option'), true);
     $default_value = $screen->get_option($option, 'default');
     if (!$value || gettype($value) !== gettype($default_value)) {
         $value = $default_value;
     }
     return $value;
 }
开发者ID:websharks,项目名称:comment-mail,代码行数:23,代码来源:UtilsUser.php


示例4: create_help_screen

	public function create_help_screen() {
		global $wp_list_table,$sitemember_screen_manage;
		
	/* 	if($_REQUEST['action']=='view'){
			$wp_list_table = new members_list_Table();
			$this->admin_screen = WP_Screen::get($this->admin_page);
			//$event_per_page = get_option( 'horse_racing_events_per_page', 10 );
			$this->admin_screen->add_option(
				'per_page', 
				array(
					'label' => 'Price per page', 
					'default' => 10, 
					'option' => 'edit_per_page'
				)
			);
		}*/
		
		$wp_list_table = new members_list_Table();
		$this->admin_screen = WP_Screen::get($sitemember_screen_manage[site_members::levelID()]);
		$this->admin_screen->add_option(
			'per_page', 
			array(
				'label' => 'List per page', 
				'default' => 10, 
				'option' => 'list_per_page'
			)
		);
	}
开发者ID:xyren,项目名称:Site-Membership,代码行数:28,代码来源:screen.php


示例5: render_screen_options

 /**
  * Render screen options for Menus.
  *
  * @since 4.3.0
  * @access public
  */
 public function render_screen_options()
 {
     // Essentially adds the screen options.
     add_filter('manage_nav-menus_columns', array($this, 'wp_nav_menu_manage_columns'));
     // Display screen options.
     $screen = WP_Screen::get('nav-menus.php');
     $screen->render_screen_options(array('wrap' => false));
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:14,代码来源:class-wp-customize-nav-menus-panel.php


示例6: applySidebar

 /**
  * Applies the new sidebar contents based on loaded files.
  *
  * This should be called during WordPress's `admin_head` hook.
  *
  * @link https://developer.wordpress.org/reference/hooks/admin_head/
  *
  * @uses Parsedown::text()
  * @uses WP_Screen::get_help_sidebar()
  * @uses WP_Screen::set_help_sidebar()
  *
  * @return @void
  */
 public function applySidebar()
 {
     foreach ($this->_sidebar_files as $file) {
         if (is_readable($file)) {
             $this->_screen->set_help_sidebar($this->_screen->get_help_sidebar() . $this->get_parsedown()->text(file_get_contents($file)));
         }
     }
 }
开发者ID:anhquan0412,项目名称:better-angels,代码行数:21,代码来源:class-wp-screen-help-loader.php


示例7: render_screen_options

 /**
  * Render screen options for Menus.
  *
  * @since 4.3.0
  * @access public
  */
 public function render_screen_options()
 {
     // Adds the screen options.
     require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
     add_filter('manage_nav-menus_columns', 'wp_nav_menu_manage_columns');
     // Display screen options.
     $screen = WP_Screen::get('nav-menus.php');
     $screen->render_screen_options(array('wrap' => false));
 }
开发者ID:idies,项目名称:escience-2016-wp,代码行数:15,代码来源:class-wp-customize-nav-menus-panel.php


示例8: action_screen_options

 /**
  * Adds Screen Options for This Tab
  *
  * @return void
  */
 public function action_screen_options($screen)
 {
     if (!$this->is_active()) {
         return;
     }
     $record_screen = WP_Screen::get(Tribe__Events__Aggregator__Records::$post_type);
     $args = array('label' => esc_html__('Records per page', 'the-events-calendar'), 'default' => 10, 'option' => 'tribe_records_scheduled_per_page');
     $record_screen->add_option('per_page', $args);
     $screen->add_option('per_page', $args);
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:15,代码来源:Scheduled.php


示例9: create_help_screen

        public function create_help_screen()
        {
            $current_screen = get_current_screen();
            $this->admin_screen = WP_Screen::get($current_screen);
            $this->admin_screen->add_help_tab(array('title' => __('Similar Settings', WP_ULIKE_SLUG), 'id' => 'overview_tab', 'content' => '<p>' . __('WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.', WP_ULIKE_SLUG) . '</p>' . '<p>' . '<strong>' . __('Logging Method', WP_ULIKE_SLUG) . ' : </strong></p>' . '<ul>' . '<li>' . __('If you select <strong>"Do Not Log"</strong> method: Any data logs can\'t save, There is no limitation in the like/dislike, unlike/undislike capacity do not work', WP_ULIKE_SLUG) . '</li>' . '<li>' . __('If you select <strong>"Logged By Cookie"</strong> method: Any data logs can\'t save, The like/dislike condition will be limited by SetCookie, unlike/undislike capacity do not work', WP_ULIKE_SLUG) . '</li>' . '<li>' . __('If you select <strong>"Logged By IP"</strong> method: Data logs will save for all users, the convey of like/dislike condition will check by user IP', WP_ULIKE_SLUG) . '</li>' . '<li>' . __('If you select <strong>"Logged By Cookie & IP"</strong> method: Data logs will save for all users, the convey of like/dislike condition will check by user IP & SetCookie', WP_ULIKE_SLUG) . '</li>' . '<li>' . __('If you select <strong>"Logged By Username"</strong> method: data logs only is saved for registered users, the convey of like/dislike condition will check by username, There is no permission for guest users to unlike/undislike', WP_ULIKE_SLUG) . '</li>
			</ul>' . '<p>' . '<strong>' . __('Template Variables', WP_ULIKE_SLUG) . ' : </strong></p>' . '<ul>' . '<li>' . '<code>%START_WHILE%</code> : ' . __('Start the loop of logs', WP_ULIKE_SLUG) . ' <span style="color:red">(' . __('required', WP_ULIKE_SLUG) . ')</span></li>' . '<li>' . '<code>%END_WHILE%</code> : ' . __('End of the while loop', WP_ULIKE_SLUG) . ' <span style="color:red">(' . __('required', WP_ULIKE_SLUG) . ')</span></li>' . '<li>' . '<code>%USER_NAME%</code> : ' . __('Display the liker name', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%USER_AVATAR%</code> : ' . __('Display the liker avatar (By Gravatar)', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%BP_PROFILE_URL%</code> : ' . __('Display the BuddyPress user profile url', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%UM_PROFILE_URL%</code> : ' . __('Display the UltimateMemebr user profile url', WP_ULIKE_SLUG) . '</li><hr>' . '<li>' . '<code>%POST_LIKER%</code> : ' . __('Display the liker name', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%POST_PERMALINK%</code> : ' . __('Display the permalink', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%POST_COUNT%</code> : ' . __('Display the likes count number', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%POST_TITLE%</code> : ' . __('Display the post title', WP_ULIKE_SLUG) . '</li><hr>' . '<li>' . '<code>%COMMENT_LIKER%</code> : ' . __('Display the liker name', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%COMMENT_AUTHOR%</code> : ' . __('Display the comment author name', WP_ULIKE_SLUG) . '</li>' . '<li>' . '<code>%COMMENT_COUNT%</code> : ' . __('Display the likes count number', WP_ULIKE_SLUG) . '</li>' . '</ul>', 'callback' => false));
            $this->admin_screen->add_help_tab(array('title' => __('Posts', WP_ULIKE_SLUG), 'id' => 'posts_tab', 'content' => '<p>' . '<strong>' . __('Automatic display', WP_ULIKE_SLUG) . ' : </strong></p><ul><li>' . __('If you disable this option, you have to put manually this code on wordpress while loop', WP_ULIKE_SLUG) . '<br /><code dir="ltr">&lt;?php if(function_exists(\'wp_ulike\')) wp_ulike(\'get\'); ?&gt;</code>' . '</li></ul>' . '<p>' . '<strong>' . __('Users Like Box Template', WP_ULIKE_SLUG) . ' - ' . __('Default Template:', WP_ULIKE_SLUG) . ' </strong></p><ul><li><code>&lt;p style="margin-top:5px"&gt; ' . __('Users who have LIKED this post:', WP_ULIKE_SLUG) . '&lt;/p&gt; &lt;ul class="tiles"&gt;%START_WHILE%&lt;li&gt;&lt;a  href="%BP_PROFILE_URL%" class="user-tooltip" title="%USER_NAME%"&gt;%USER_AVATAR%&lt;/a&gt;&lt;/li&gt;%END_WHILE%&lt;/ul&gt;</code>' . '</li></ul>', 'callback' => false));
            $this->admin_screen->add_help_tab(array('title' => __('Comments', WP_ULIKE_SLUG), 'id' => 'comments_tab', 'content' => '<p>' . '<strong>' . __('Automatic display', WP_ULIKE_SLUG) . ' : </strong></p><ul><li>' . __('If you disable this option, you have to put manually this code on comments text', WP_ULIKE_SLUG) . '<br /><code dir="ltr">&lt;?php if(function_exists(\'wp_ulike_comments\')) wp_ulike_comments(\'get\'); ?&gt;</code>' . '</li></ul>' . '<p>' . '<strong>' . __('Users Like Box Template', WP_ULIKE_SLUG) . ' - ' . __('Default Template:', WP_ULIKE_SLUG) . ' </strong></p><ul><li><code>&lt;p style="margin-top:5px"&gt; ' . __('Users who have LIKED this comment:', WP_ULIKE_SLUG) . '&lt;/p&gt; &lt;ul class="tiles"&gt;%START_WHILE%&lt;li&gt;&lt;a  href="%BP_PROFILE_URL%" class="user-tooltip" title="%USER_NAME%"&gt;%USER_AVATAR%&lt;/a&gt;&lt;/li&gt;%END_WHILE%&lt;/ul&gt;</code>' . '</li></ul>', 'callback' => false));
            $this->admin_screen->add_help_tab(array('title' => __('BuddyPress', WP_ULIKE_SLUG), 'id' => 'bp_tab', 'content' => '<p>' . '<strong>' . __('Automatic display', WP_ULIKE_SLUG) . ' : </strong></p><ul><li>' . __('If you disable this option, you have to put manually this code on buddypres activities content', WP_ULIKE_SLUG) . '<br /><code dir="ltr">&lt;?php if(function_exists(\'wp_ulike_buddypress\')) wp_ulike_buddypress(\'get\'); ?&gt;</code>' . '</li></ul>' . '<p>' . '<strong>' . __('Users Like Box Template', WP_ULIKE_SLUG) . ' - ' . __('Default Template:', WP_ULIKE_SLUG) . ' </strong></p><ul><li><code>&lt;p style="margin-top:5px"&gt; ' . __('Users who have liked this activity:', WP_ULIKE_SLUG) . '&lt;/p&gt; &lt;ul class="tiles"&gt;%START_WHILE%&lt;li&gt;&lt;a  href="%BP_PROFILE_URL%" class="user-tooltip" title="%USER_NAME%"&gt;%USER_AVATAR%&lt;/a&gt;&lt;/li&gt;%END_WHILE%&lt;/ul&gt;</code>' . '</li></ul>' . '<p>' . '<strong>' . __('Post Activity Text', WP_ULIKE_SLUG) . ' - ' . __('Default Template:', WP_ULIKE_SLUG) . ' </strong></p><ul><li><code>&lt;strong&gt;%POST_LIKER%&lt;/strong&gt; liked &lt;a href="%POST_PERMALINK%" title="%POST_TITLE%"&gt;%POST_TITLE%&lt;/a&gt;. (So far, This post has &lt;span class="badge"&gt;%POST_COUNT%&lt;/span&gt; likes)</code>' . '</li></ul>' . '<p>' . '<strong>' . __('Comment Activity Text', WP_ULIKE_SLUG) . ' - ' . __('Default Template:', WP_ULIKE_SLUG) . ' </strong></p><ul><li><code>&lt;strong&gt;%COMMENT_LIKER%&lt;/strong&gt; liked &lt;strong&gt;%COMMENT_AUTHOR%&lt;/strong&gt; comment. (So far, %COMMENT_AUTHOR% has &lt;span class="badge"&gt;%COMMENT_COUNT%&lt;/span&gt; likes for this comment)</code>' . '</li></ul>', 'callback' => false));
            $this->admin_screen->add_help_tab(array('title' => __('bbPress', WP_ULIKE_SLUG), 'id' => 'bb_tab', 'content' => '<p>' . '<strong>' . __('Automatic display', WP_ULIKE_SLUG) . ' : </strong></p><ul><li>' . __('If you disable this option, you have to put manually this code on buddypres activities content', WP_ULIKE_SLUG) . '<br /><code dir="ltr">&lt;?php if(function_exists(\'wp_ulike_bbpress\')) wp_ulike_bbpress(\'get\'); ?&gt;</code>' . '</li></ul>' . '<p>' . '<strong>' . __('Users Like Box Template', WP_ULIKE_SLUG) . ' - ' . __('Default Template:', WP_ULIKE_SLUG) . ' </strong></p><ul><li><code>&lt;p style="margin-top:5px"&gt; ' . __('Users who have liked this activity:', WP_ULIKE_SLUG) . '&lt;/p&gt; &lt;ul class="tiles"&gt;%START_WHILE%&lt;li&gt;&lt;a  href="%BP_PROFILE_URL%" class="user-tooltip" title="%USER_NAME%"&gt;%USER_AVATAR%&lt;/a&gt;&lt;/li&gt;%END_WHILE%&lt;/ul&gt;</code>' . '</li></ul>', 'callback' => false));
            $this->admin_screen->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p><p><a href="https://wordpress.org/plugins/wp-ulike/faq/" target="_blank">' . __('FAQ', WP_ULIKE_SLUG) . '</a></p><p><a href="https://wordpress.org/support/plugin/wp-ulike" target="_blank">' . __('Support', WP_ULIKE_SLUG) . '</a></p>');
        }
开发者ID:NickIvanter,项目名称:wp-ulike,代码行数:12,代码来源:class-settings.php


示例10: on_load

 function on_load()
 {
     $help_message = new help_message();
     $current_screen = get_current_screen();
     $this->pagehook = $current_screen->id;
     $admin_screen = WP_Screen::get($current_screen->id);
     /*Help option*/
     $admin_screen->add_help_tab(array('title' => __('help', 'WP-OliveCart'), 'id' => 'help_tab', 'content' => $help_message->message(), 'callback' => false));
     wp_enqueue_script('postbox');
     add_meta_box('show_box1', __('Other Items No1', 'WP-OliveCart'), array(&$this, 'show_box1'), $this->pagehook, 'normal', 'core');
     add_meta_box('show_box2', __('Other Items No2', 'WP-OliveCart'), array(&$this, 'show_box2'), $this->pagehook, 'normal', 'core');
     add_meta_box('show_box3', __('Other Items No3', 'WP-OliveCart'), array(&$this, 'show_box3'), $this->pagehook, 'normal', 'core');
 }
开发者ID:kanian55,项目名称:ibcmart,代码行数:13,代码来源:cart_chages.php


示例11: on_load

 function on_load()
 {
     $help_message = new help_message();
     $current_screen = get_current_screen();
     $this->pagehook = $current_screen->id;
     $admin_screen = WP_Screen::get($current_screen->id);
     /*Help option*/
     $admin_screen->add_help_tab(array('title' => __('help', 'WP-OliveCart'), 'id' => 'help_tab', 'content' => $help_message->message(), 'callback' => false));
     wp_enqueue_script('postbox');
     #add_meta_box( 'show_box1'  ,__('Create the "Pay with PayPal" button',  'WP-OliveCart'),
     #array(&$this, 'show_box1'),   $this->pagehook, 'normal', 'core');
     add_meta_box('show_box2', __('Custom Message (HTML Tags)', 'WP-OliveCart'), array(&$this, 'show_box2'), $this->pagehook, 'normal', 'core');
 }
开发者ID:kanian55,项目名称:ibcmart,代码行数:13,代码来源:cart_end_message.php


示例12: create_help_panel

 /**
  * Add Help Panel
  */
 function create_help_panel()
 {
     /**
      * Create the WP_Screen object against your admin page handle
      * This ensures we're working with the right admin page
      */
     $this->admin_screen = WP_Screen::get($this->admin_page);
     /**
      * Content specified inline
      */
     $this->admin_screen->add_help_tab(array('title' => __('About Plugin', 'wp-github-gist'), 'id' => 'about_tab', 'content' => '<p>' . __("WP Github Gist WordPress Plugin, provides the ability to embed gist and files from Github in your blog posts or pages. Even though Github doesn't provide a way to embed files, this Plugin still works by using the gist-it service.", 'wp-github-gist') . '</p>', 'callback' => false));
     // Add help sidebar
     $this->admin_screen->set_help_sidebar('<p><strong>' . __('More information', 'wp-github-gist') . '</strong></p>' . '<p><a href = "http://sudarmuthu.com/wordpress/wp-github-gist">' . __('Plugin Homepage/support', 'wp-github-gist') . '</a></p>' . '<p><a href = "http://sudarmuthu.com/blog">' . __("Plugin author's blog", 'wp-github-gist') . '</a></p>' . '<p><a href = "http://sudarmuthu.com/wordpress/">' . __("Other Plugin's by Author", 'wp-github-gist') . '</a></p>');
 }
开发者ID:rvrangel,项目名称:wp-github-gist,代码行数:17,代码来源:wp-github-gist.php


示例13: on_load

 function on_load()
 {
     $help_message = new help_message();
     $current_screen = get_current_screen();
     $admin_screen = WP_Screen::get($current_screen->id);
     $this->pagehook = $current_screen->id;
     /*Help option*/
     $admin_screen->add_help_tab(array('title' => __('help', 'WP-OliveCart'), 'id' => 'help_tab', 'content' => $help_message->message(), 'callback' => false));
     wp_enqueue_script('postbox');
     #if(WPLANG == 'ja'){
     #add_meta_box( 'pref_postage_setup'  ,__('Pref Postage Setup','WP-OliveCart'),
     #array(&$this, 'pref_postage_setup'),   $this->pagehook, 'normal', 'core');
     #}
     add_meta_box('total_postage_setup', __('Total Postage Setup', 'WP-OliveCart'), array(&$this, 'total_postage_setup'), $this->pagehook, 'normal', 'core');
 }
开发者ID:kanian55,项目名称:ibcmart,代码行数:15,代码来源:cart_postage.php


示例14: on_load

 function on_load()
 {
     $help_message = new help_message();
     $current_screen = get_current_screen();
     $this->pagehook = $current_screen->id;
     $admin_screen = WP_Screen::get($current_screen->id);
     /*Help option*/
     $admin_screen->add_help_tab(array('title' => __('help', 'WP-OliveCart'), 'id' => 'help_tab', 'content' => $help_message->message(), 'callback' => false));
     wp_enqueue_script('postbox');
     add_meta_box('show_box1', __('Mobile Theme Setup', 'WP-OliveCart'), array(&$this, 'show_box1'), $this->pagehook, 'normal', 'core');
     add_meta_box('show_box2', __('Cart Security Setup', 'WP-OliveCart'), array(&$this, 'show_box2'), $this->pagehook, 'normal', 'core');
     add_meta_box('show_box3', __('Add to Cart Button Option', 'WP-OliveCart'), array(&$this, 'show_box3'), $this->pagehook, 'normal', 'core');
     #add_meta_box( 'show_box4' ,__('Consumption tax Setup',  'WP-OliveCart'),
     #	array(&$this, 'show_box4'),   $this->pagehook, 'normal', 'core');
     add_meta_box('show_box5', __('SendMail Address', 'WP-OliveCart'), array(&$this, 'show_box5'), $this->pagehook, 'normal', 'core');
 }
开发者ID:kanian55,项目名称:ibcmart,代码行数:16,代码来源:cart_options.php


示例15: aioseop_init_class

 function aioseop_init_class()
 {
     global $aiosp;
     require_once AIOSEOP_PLUGIN_DIR . 'aioseop_functions.php';
     require_once AIOSEOP_PLUGIN_DIR . 'aioseop_class.php';
     $aiosp = new All_in_One_SEO_Pack();
     if (aioseop_option_isset('aiosp_unprotect_meta')) {
         add_filter('is_protected_meta', 'aioseop_unprotect_meta', 10, 3);
     }
     add_action('init', array($aiosp, 'add_hooks'));
     if (defined('DOING_AJAX') && !empty($_POST) && !empty($_POST['action']) && $_POST['action'] === 'aioseop_ajax_scan_header') {
         remove_action('init', array($aiosp, 'add_hooks'));
         add_action('admin_init', 'aioseop_scan_post_header');
         add_action('shutdown', 'aioseop_ajax_scan_header');
         // if the action doesn't run -- pdb
         include_once ABSPATH . 'wp-admin/includes/screen.php';
         global $current_screen;
         if (class_exists('WP_Screen')) {
             $current_screen = WP_Screen::get('front');
         }
     }
 }
开发者ID:pankajsinghjarial,项目名称:SYLC,代码行数:22,代码来源:all_in_one_seo_pack.php


示例16: set_current_screen

/**
 * Set the current screen object
 *
 * @since 3.0.0
 *
 * @param mixed $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen,
 *	                       or an existing screen object.
 */
function set_current_screen($hook_name = '')
{
    WP_Screen::get($hook_name)->set_current_screen();
}
开发者ID:robbenz,项目名称:plugs,代码行数:12,代码来源:screen.php


示例17: add_action

    add_action('wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url');
    add_action('wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header');
    add_action('wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings');
    add_action('wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links');
}
if (aioseop_option_isset('aiosp_unprotect_meta')) {
    add_filter('is_protected_meta', 'aioseop_unprotect_meta', 10, 3);
}
if (!function_exists('aioseop_scan_post_header')) {
    function aioseop_scan_post_header()
    {
        require_once ABSPATH . WPINC . '/default-filters.php';
        global $wp_query;
        $wp_query->query_vars['paged'] = 0;
        query_posts('post_type=post&posts_per_page=1');
        if (have_posts()) {
            the_post();
        }
    }
}
if (defined('DOING_AJAX') && !empty($_POST) && !empty($_POST['action']) && $_POST['action'] === 'aioseop_ajax_scan_header') {
    remove_action('init', array($aiosp, 'add_hooks'));
    add_action('admin_init', 'aioseop_scan_post_header');
    add_action('shutdown', 'aioseop_ajax_scan_header');
    // if the action doesn't run -- pdb
    include_once ABSPATH . 'wp-admin/includes/screen.php';
    global $current_screen;
    if (class_exists('WP_Screen')) {
        $current_screen = WP_Screen::get('front');
    }
}
开发者ID:benytocarlo,项目名称:wordpress-package,代码行数:31,代码来源:all_in_one_seo_pack.php


示例18: __construct

 /**
  * Constructor.
  *
  * The child class should call this constructor from its own constructor to override
  * the default $args.
  *
  * @since 3.1.0
  * @access public
  *
  * @param array|string $args {
  *     Array or string of arguments.
  *
  *     @type string $plural   Plural value used for labels and the objects being listed.
  *                            This affects things such as CSS class-names and nonces used
  *                            in the list table, e.g. 'posts'. Default empty.
  *     @type string $singular Singular label for an object being listed, e.g. 'post'.
  *                            Default empty
  *     @type bool   $ajax     Whether the list table supports AJAX. This includes loading
  *                            and sorting data, for example. If true, the class will call
  *                            the {@see _js_vars()} method in the footer to provide variables
  *                            to any scripts handling AJAX events. Default false.
  *     @type string $screen   String containing the hook name used to determine the current
  *                            screen. If left null, the current screen will be automatically set.
  *                            Default null.
  * }
  */
 public function __construct($args = array())
 {
     $args = wp_parse_args($args, array('plural' => '', 'singular' => '', 'ajax' => false, 'screen' => null));
     //$this->screen = convert_to_screen( $args['screen'] );
     $this->screen = WP_Screen::get($args['screen']);
     add_filter("manage_{$this->screen->id}_columns", array($this, 'get_columns'), 0);
     if (!$args['plural']) {
         $args['plural'] = $this->screen->base;
     }
     $args['plural'] = sanitize_key($args['plural']);
     $args['singular'] = sanitize_key($args['singular']);
     $this->_args = $args;
     if ($args['ajax']) {
         // wp_enqueue_script( 'list-table' );
         add_action('admin_footer', array($this, '_js_vars'));
     }
     if (empty($this->modes)) {
         $this->modes = array('list' => __('List View'), 'excerpt' => __('Excerpt View'));
     }
 }
开发者ID:primus1989,项目名称:https---github.com-DataDesignSystems-drishtiq,代码行数:46,代码来源:unibill-class-wp-list-table.php


示例19: addHelpTab

 /**
  * Display inline help content
  *
  * @since 1.0.0
  *
  * @param WP_Screen $screen current screen
  *
  * @return void
  */
 public static function addHelpTab($screen)
 {
     if (!$screen) {
         return;
     }
     $content = '<p>' . esc_html(__('Twitter Embedded Tweet and Timeline widgets support customization of color theme, link color, and border color inside a rendered widget.', 'twitter')) . '</p>';
     $content .= '<p>' . esc_html(__('Choose a light or dark theme to best match the background color and text color of surrounding content.', 'twitter')) . '</p>';
     $content .= '<p>' . esc_html(__('Link color is applied to linked text including URLs, #hashtags, and @mentions.', 'twitter')) . '</p>';
     $content .= '<p>' . esc_html(__('Border color applies to borders separating Tweet sections or individual Tweets.', 'twitter')) . '</p>';
     $screen->add_help_tab(array('id' => 'twitter-theme-help', 'title' => static::featureName(), 'content' => $content));
 }
开发者ID:cemoulto,项目名称:wordpress,代码行数:20,代码来源:Theme.php


示例20: jwl_help_screen

 function jwl_help_screen()
 {
     /** 
      * Create the WP_Screen object against your admin page handle
      * This ensures we're working with the right admin page
      */
     $this->admin_screen = WP_Screen::get($this->pagehook);
     // Content specified inline
     $this->admin_screen->add_help_tab(array('title' => __('Help Documentation', 'jwl-ultimate-tinymce'), 'id' => 'help_tab', 'content' => '<div class="help_wrapper">' . __('<ul><li class="help_tab_list_image">The best resource for expedited help is my <a target="_blank" href="http://www.forum.joshlobe.com/">Support Forum</a>.</li><li class="help_tab_list_image">Additional information on each option may be found on the <a target="_blank" href="http://docs.joshlobe.com/">Ultimate Tinymce WIKI</a>.</li><li class="help_tab_list_image">You can also visit the <a target="_blank" href="http://www.plugins.joshlobe.com/">Plugin Page</a> to read user comments.</li></ul>', 'jwl-ultimate-tinymce') . '</div>', 'callback' => false));
     /**
      * Content generated by callback
      * The callback fires when tab is rendered - args: WP_Screen object, current tab
      */
     //$this->admin_screen->add_help_tab(
     //array( 'title' => 'Info on this Page', 'id' => 'page_info', 'content' => '', 'callback' => create_function('','echo "<p>This is my generated content.</p>";' )));
     $this->admin_screen->set_help_sidebar('<p>' . __('Ultimate Tinymce Help<br /><br /><a target="_blank" href="http://www.forum.joshlobe.com/">Support Forum</a>', 'jwl-ultimate-tinymce') . '</p><p><a target="_blank" href="http://docs.joshlobe.com/">' . __('Ultimate Tinymce WIKI', 'jwl-ultimate-tinymce') . '</a></p>');
 }
开发者ID:WaitButWhy,项目名称:www,代码行数:17,代码来源:main.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP WP_Scripts类代码示例发布时间:2022-05-23
下一篇:
PHP WP_SMS类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap