Beispiel #1
1
 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();
 }
Beispiel #2
0
	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'
			)
		);
	}
 /**
  * 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));
 }
 /**
  * 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));
 }
 /**
  * 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);
 }
 /**
  * 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_history_per_page');
     // We need to Add on both because of a WP Limitation on WP_Screen
     $record_screen->add_option('per_page', $args);
     $screen->add_option('per_page', $args);
 }
        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>');
        }
Beispiel #8
0
 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');
 }
Beispiel #9
0
 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');
 }
 /**
  * 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>');
 }
Beispiel #11
0
 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');
 }
Beispiel #12
0
 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');
 }
Beispiel #13
0
/**
 * 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();
}
    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');
    }
}
 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');
         }
     }
 }
 /**
  * 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'));
     }
 }
 /**
  * Render form options for Menus.
  *
  * @since 4.3.0
  * @access public
  */
 public function render_form_options()
 {
     // Essentially adds the form options.
     add_filter('manage_nav-menus_columns', array($this, 'wp_nav_menu_manage_columns'));
     // Display form options.
     $screen = WP_Screen::get('nav-menus.php');
     $screen->render_form_options();
 }
 private function get_list_table()
 {
     $GLOBALS['hook_suffix'] = '';
     $screen = WP_Screen::get();
     $screen->id = $this->post_type->name;
     $screen->post_type = $this->post_type->name;
     WP_Screen::get($screen)->set_current_screen();
     $_GET['post_type'] = $this->post_type->name;
     add_filter('page_row_actions', array($this, 'post_table_row_actions'), 1000);
     add_filter('post_row_actions', array($this, 'post_table_row_actions'), 1000);
     add_filter("bulk_actions-{$screen->id}", array($this, 'post_table_bulk_actions'), 1000);
     //add_filter('user_has_cap', array($this, 'post_table_current_user_can'), 1000, 3);
     return _get_list_table('WP_Posts_List_Table');
 }
 public static function ids_from_url($url)
 {
     global $wp;
     $wp = new WP();
     //We need to cheat telling WP we are not in admin area to parse the URL properly
     $current_uri = $_SERVER['REQUEST_URI'];
     $self = $_SERVER['PHP_SELF'];
     $get = $_GET;
     global $current_screen;
     if ($current_screen) {
         $stored_current_screen = $current_screen->id;
     } else {
         require_once ABSPATH . '/wp-admin/includes/screen.php';
         $current_screen = WP_Screen::get('front');
     }
     $_SERVER['REQUEST_URI'] = $url;
     $_SERVER['PHP_SELF'] = 'foo';
     $urlParts = explode('?', $url);
     if (count($urlParts) > 1) {
         parse_str($urlParts[1], $_GET);
     }
     $wp->parse_request();
     $query = new WP_Query($wp->query_vars);
     $query->parse_query();
     //Set the global post in case that no-one is set and we have a single query
     global $post;
     if (!$post && $query->have_posts() && $query->is_singular()) {
         $post = $query->next_post();
         setup_postdata($post);
     }
     //Make the query accessible to add it to the response
     global $upfront_ajax_query;
     $upfront_ajax_query = clone $query;
     // Intercept /edit/(post|page)/id
     $editor = Upfront_ContentEditor_VirtualPage::serve();
     if ($editor->parse_page()) {
         global $wp_query;
         $query = $wp_query;
         $post = $wp_query->next_post();
         setup_postdata($post);
     }
     $_SERVER['REQUEST_URI'] = $current_uri;
     $_SERVER['PHP_SELF'] = $self;
     $_GET = $get;
     if (isset($stored_current_screen)) {
         //$current_screen = $current_screen::get($stored_current_screen);
         $current_screen = call_user_func(array($current_screen, 'get', $stored_current_screen));
     }
     $cascade = self::get_entity_ids(self::get_entity_cascade($query));
     return $cascade;
 }
 birch_defmulti($ns, 'enqueue_scripts_post_list', $ns->get_post_type_lookup_config, function ($arg) {
 });
 birch_defmulti($ns, 'load_post_edit', $ns->get_post_type_lookup_config, function ($arg) {
 });
 birch_defmulti($ns, 'load_post_new', $ns->get_post_type_lookup_config, function ($arg) {
 });
 birch_defmulti($ns, 'save_post', $ns->get_post_type_lookup_config, function ($post_a) {
 });
 birch_defmulti($ns, 'pre_save_post', $ns->get_post_type_lookup_config, function ($post_data, $post_attr) {
     return $post_data;
 });
 birch_defn($ns, 'get_wp_screen', function ($hook_name) use($ns) {
     if (substr($hook_name, -4) !== '.php') {
         $hook_name = $hook_name . '.php';
     }
     $screen = WP_Screen::get($hook_name);
     return $screen;
 });
 birch_defn($ns, 'register_3rd_scripts', function () use($ns) {
     global $birchpress;
     wp_register_script('underscore_string', $birchpress->get_framework_url() . '/lib/assets/js/underscore/underscore.string.min.js', array('underscore'), '2.3.0');
 });
 birch_defn($ns, 'register_core_scripts', function () use($ns) {
     global $birchpress;
     $version = $birchpress->get_version();
     wp_register_script('birchpress', $birchpress->get_framework_url() . '/assets/js/birchpress/base.js', array('underscore', 'underscore_string'), "{$version}");
     wp_register_script('birchpress_util', $birchpress->get_framework_url() . '/assets/js/birchpress/util/base.js', array('birchpress'), "{$version}");
 });
 birch_defn($ns, 'get_current_post_type', function () {
     global $current_screen;
     if ($current_screen && $current_screen->post_type) {
 /**
  * Fetches a WP_Screen object for this page.
  *
  * @see http://codex.wordpress.org/Class_Reference/WP_Screen
  *
  * @return WP_Screen
  */
 public function getWPScreen()
 {
     if (!$this->_wpScreen) {
         $this->_wpScreen = WP_Screen::get($this->_hook_name);
     }
     return $this->_wpScreen;
 }
Beispiel #22
0
 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>');
 }
Beispiel #23
0
 public static function prepare_post($this_post)
 {
     $post_data = array();
     //We need to cheat telling WP we are not in admin area
     // to get the same output than in the frontend
     global $current_screen;
     require_once ABSPATH . '/wp-admin/includes/screen.php';
     $current_screen = WP_Screen::get('front');
     global $post;
     $post = $this_post;
     setup_postdata($post);
     global $wp_query, $more;
     $post_data['in_the_loop'] = $wp_query->in_the_loop;
     // This below with post query rewrite is an inline fix for WP not sanity checking before iteration: https://core.trac.wordpress.org/ticket/26321
     $post_data['old_query_posts'] = $wp_query->posts;
     //Make sure we show the whole post content
     $more = 1;
     $wp_query->is_single = true;
     $wp_query->in_the_loop = true;
     $wp_query->posts = array();
 }
Beispiel #24
0
 /**
  * Add settings Panel
  */
 function create_settings_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', 'bulk-delete'), 'id' => 'about_tab', 'content' => '<p>' . __('This plugin allows you to delete posts in bulk from selected categories, tags, custom taxonomies or by post status like drafts, pending posts, scheduled posts etc.', 'bulk-delete') . '</p>', 'callback' => false));
     // Add help sidebar
     $this->admin_screen->set_help_sidebar('<p><strong>' . __('More information', 'bulk-delete') . '</strong></p>' . '<p><a href = "http://sudarmuthu.com/wordpress/bulk-delete">' . __('Plugin Homepage/support', 'bulk-delete') . '</a></p>' . '<p><a href = "http://sudarmuthu.com/wordpress/bulk-delete/pro-addons">' . __("Buy pro addons", 'bulk-delete') . '</a></p>' . '<p><a href = "http://sudarmuthu.com/blog">' . __("Plugin author's blog", 'bulk-delete') . '</a></p>' . '<p><a href = "http://sudarmuthu.com/wordpress/">' . __("Other Plugin's by Author", 'bulk-delete') . '</a></p>');
 }
Beispiel #25
0
 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"><p>' . __('<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">You can also visit the <a target="_blank" href="http://www.plugins.joshlobe.com/">Plugin Page</a> to read user comments.</ul>', 'jwl-ultimate-tinymce') . '</p></div>', 'callback' => false));
     $this->admin_screen->add_help_tab(array('title' => __('Settings Page Tips', 'jwl-ultimate-tinymce'), 'id' => 'help_tab2', 'content' => '<div class="help_wrapper"><p>' . __('Here are some important items to remember regarding the new settings page.<br /><ul><li class="help_tab_list_image">Each option has a dedicated help icon.  Clicking the help icon (blue question mark) for a specific option will open a new window with a unique help file.</li><li class="help_tab_list_image">Boxes can be opened/closed and sorted by clicking and dragging the box headers.  Boxes can also be enabled/disabled via the "Screen Options" tab in the upper-right corner.</li><li class="help_tab_list_image">Set your screen layout to two columns (via Screen Options) for best results.</li><li class="help_tab_list_image">The "Row Selection" button allows you to choose which row of the visual editor the button will appear.</ul>', 'jwl-ultimate-tinymce') . '</p></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>');
     //$this->admin_screen->add_option( 'per_page', array( 'label' => 'Entries per page', 'default' => 20, 'option' => 'edit_per_page' ));
     //$this->admin_screen->add_option( 'layout_columns', array( 'default' => 3, 'max' => 5 ));
     // This option will NOT show up
     //$this->admin_screen->add_option( 'invisible_option', array( 'label'	=> 'I am a custom option', 'default' => 'wow', 'option' => 'my_option_id' ));
     /**
      * But old-style metaboxes still work for creating custom checkboxes in the option panel
      * This is a little hack-y, but it works
      */
     //add_meta_box( 'jwl_help_meta_id', 'Help Metabox', array(&$this,'create_my_metabox'), $this->admin_page );
 }
    }
}
// load configuration
require_once WP_PLUGIN_DIR . '/wp2grav/includes/wp2grav.config.php';
if (WP2GRAV_EXPORT_HTMLPURIFIER) {
    require_once WP_PLUGIN_DIR . '/wp2grav/vendor/htmlpurifier/library/HTMLPurifier.auto.php';
}
// init theme
if (file_exists(WP_PLUGIN_DIR . '/wp2grav/includes/theme_init.php')) {
    require_once WP_PLUGIN_DIR . '/wp2grav/includes/theme_init.php';
}
// Support
require_once WP_PLUGIN_DIR . '/wp2grav/includes/wp2grav-view.class.php';
// Do the businesss
require_once WP_PLUGIN_DIR . '/wp2grav/includes/wp2grav.class.php';
require_once WP_PLUGIN_DIR . '/wp2grav/includes/wp2grav-admin.class.php';
$plugin = 'wp2grav/' . basename(__FILE__);
if (is_admin()) {
    new WP2GravAdmin($plugin, __FILE__);
    if ($_POST['wp2grav-action']) {
        // set screen context to site
        require_once ABSPATH . 'wp-admin/includes/screen.php';
        if (function_exists('get_current_screen')) {
            $GLOBALS['current_screen'] = get_current_screen();
        } else {
            $GLOBALS['current_screen'] = \WP_Screen::get('front');
        }
    }
} else {
    new WP2Grav($plugin);
}
 function aioseop_init_class()
 {
     global $aiosp;
     load_plugin_textdomain('all-in-one-seo-pack', false, dirname(plugin_basename(__FILE__)) . '/i18n/');
     require_once AIOSEOP_PLUGIN_DIR . 'inc/aioseop_functions.php';
     require_once AIOSEOP_PLUGIN_DIR . 'aioseop_class.php';
     require_once AIOSEOP_PLUGIN_DIR . 'inc/aioseop_updates_class.php';
     require_once AIOSEOP_PLUGIN_DIR . 'inc/commonstrings.php';
     require_once AIOSEOP_PLUGIN_DIR . 'admin/display/postedit.php';
     require_once AIOSEOP_PLUGIN_DIR . 'admin/display/general-metaboxes.php';
     require_once AIOSEOP_PLUGIN_DIR . 'inc/aiosp_common.php';
     require_once AIOSEOP_PLUGIN_DIR . 'admin/meta_import.php';
     if (AIOSEOPPRO) {
         require_once AIOSEOP_PLUGIN_DIR . 'pro/functions_general.php';
         require_once AIOSEOP_PLUGIN_DIR . 'pro/functions_class.php';
         require_once AIOSEOP_PLUGIN_DIR . 'pro/aioseop_pro_updates_class.php';
     }
     aiosp_seometa_import();
     // call importer functions... this should be moved somewhere better
     $aiosp = new All_in_One_SEO_Pack();
     $aioseop_updates = new AIOSEOP_Updates();
     if (AIOSEOPPRO) {
         $aioseop_pro_updates = new AIOSEOP_Pro_Updates();
         add_action('admin_init', array($aioseop_pro_updates, 'version_updates'), 12);
     }
     if (aioseop_option_isset('aiosp_unprotect_meta')) {
         add_filter('is_protected_meta', 'aioseop_unprotect_meta', 10, 3);
     }
     add_action('init', array($aiosp, 'add_hooks'));
     add_action('admin_init', array($aioseop_updates, 'version_updates'), 11);
     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');
         }
     }
 }
Beispiel #28
0
/**
 *	Function, set up admin menu
 *	
 *	@return void
 */
function uds_billboard_menu()
{
    global $menu;
    $position = null;
    $icon = UDS_BILLBOARD_URL . 'images/menu-icon.png';
    $ubillboard = add_menu_page("uBillboard", "uBillboard", 'edit_pages', 'uds_billboard_admin', 'uds_billboard_admin', $icon, $position);
    $add_title = __("Add Billboard", uds_billboard_textdomain);
    $general_title = __("General Options", uds_billboard_textdomain);
    $import_title = __("Import/Export", uds_billboard_textdomain);
    $ubillboard_add = add_submenu_page('uds_billboard_admin', $add_title, $add_title, 'edit_pages', 'uds_billboard_edit', 'uds_billboard_edit');
    $ubillboard_general = add_submenu_page('uds_billboard_admin', $general_title, $general_title, 'manage_options', 'uds_billboard_general', 'uds_billboard_general');
    $ubillboard_importexport = add_submenu_page('uds_billboard_admin', $import_title, $import_title, 'import', 'uds_billboard_import_export', 'uds_billboard_import_export');
    add_action("admin_print_styles-{$ubillboard}", 'uds_billboard_enqueue_admin_styles');
    add_action("admin_print_styles-{$ubillboard_add}", 'uds_billboard_enqueue_admin_styles');
    add_action("admin_print_styles-{$ubillboard_importexport}", 'uds_billboard_enqueue_admin_styles');
    add_action("admin_print_scripts-{$ubillboard}", 'uds_billboard_enqueue_admin_scripts');
    add_action("admin_print_scripts-{$ubillboard_add}", 'uds_billboard_enqueue_admin_scripts');
    add_action("admin_print_scripts-{$ubillboard_importexport}", 'uds_billboard_enqueue_admin_scripts');
    // Contextual help
    if (class_exists('WP_Screen')) {
        WP_Screen::get($ubillboard)->add_help_tab(array('title' => __('uBillboard Help'), 'id' => 'uds-billboard-help', 'content' => @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-billboards.html'), 'callback' => false));
        WP_Screen::get($ubillboard_add)->add_help_tab(array('title' => __('uBillboard Editing Help'), 'id' => 'uds-billboard-help', 'content' => @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-edit.html'), 'callback' => false));
        WP_Screen::get($ubillboard_general)->add_help_tab(array('title' => __('uBillboard General Options Help'), 'id' => 'uds-billboard-help', 'content' => @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-general.html'), 'callback' => false));
        WP_Screen::get($ubillboard_importexport)->add_help_tab(array('title' => __('uBillboard Import/Export Help'), 'id' => 'uds-billboard-help', 'content' => @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-import.html'), 'callback' => false));
    } else {
        add_contextual_help($ubillboard, @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-billboards.html'));
        add_contextual_help($ubillboard_add, @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-edit.html'));
        add_contextual_help($ubillboard_general, @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-general.html'));
        add_contextual_help($ubillboard_importexport, @file_get_contents(UDS_BILLBOARD_PATH . '/help/contextual-import.html'));
    }
}
Beispiel #29
0
/**
 * Convert a screen string to a screen object
 *
 * @since 3.0.0
 *
 * @param string $hook_name The hook name (also known as the hook suffix) used to determine the screen.
 * @return WP_Screen Screen object.
 */
function convert_to_screen($hook_name)
{
    if (!class_exists('WP_Screen', false)) {
        _doing_it_wrong('convert_to_screen(), add_meta_box()', __("Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead."), '3.3.0');
        return (object) array('id' => '_invalid', 'base' => '_are_belong_to_us');
    }
    return WP_Screen::get($hook_name);
}
Beispiel #30
0
 /**
  * Add settings Panel
  */
 function create_settings_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', 'email-log'), 'id' => 'about_tab', 'content' => '<p>' . __('Email Log WordPress Plugin, allows you to log all emails that are sent through WordPress.', 'email-log') . '</p>', 'callback' => false));
     // Add help sidebar
     $this->admin_screen->set_help_sidebar('<p><strong>' . __('More information', 'email-log') . '</strong></p>' . '<p><a href = "http://sudarmuthu.com/wordpress/email-log">' . __('Plugin Homepage/support', 'email-log') . '</a></p>' . '<p><a href = "http://sudarmuthu.com/blog">' . __("Plugin author's blog", 'email-log') . '</a></p>' . '<p><a href = "http://sudarmuthu.com/wordpress/">' . __("Other Plugin's by Author", 'email-log') . '</a></p>');
     // Add screen options
     $this->admin_screen->add_option('per_page', array('label' => __('Entries per page', 'email-log'), 'default' => 20, 'option' => 'per_page'));
     if (!class_exists('WP_List_Table')) {
         require_once ABSPATH . WPINC . '/class-wp-list-table.php';
     }
     if (!class_exists('Email_Log_List_Table')) {
         require_once dirname(__FILE__) . '/include/class-email-log-list-table.php';
     }
     //Prepare Table of elements
     $this->logs_table = new Email_Log_List_Table();
 }