/** * Sets up pages. * * This method automatically gets triggered with the wp_loaded hook. */ public function setUp() { $_sCapability = FetchTweets_Option::get(array('capabilities', 'setting_page_capability')); if ($_sCapability) { $this->setCapability($_sCapability); } /* ( required ) Set the root page */ $_sPostTypeSlug = FetchTweets_Commons::PostTypeSlug; $this->setRootMenuPageBySlug("edit.php?post_type={$_sPostTypeSlug}"); /* ( required ) Add sub-menu items (pages or links) */ $this->addSubMenuItems(array('title' => __('Contact', 'fetch-tweets'), 'page_slug' => 'fetch_tweets_contact', 'screen_icon' => 'feedback')); /* ( optional ) Disable the automatic settings link in the plugin listing table. */ $this->setPluginSettingsLinkLabel(''); // pass an empty string. }
public function setUp() { $this->oOption = $GLOBALS['oFetchTweets_Option']; $_sCapability = FetchTweets_Option::get(array('capabilities', 'setting_page_capability'), 'manage_options'); $this->setArguments(array('labels' => $this->oProp->bIsAdmin ? $this->_getPostTypeLabelArguments() : array(), 'public' => true, 'menu_position' => 110, 'supports' => array('title'), 'taxonomies' => array(''), 'menu_icon' => $this->oProp->bIsAdmin ? FetchTweets_Commons::getPluginURL('/asset/image/menu_icon_16x16.png') : '', 'has_archive' => true, 'hierarchical' => false, 'show_admin_column' => true, 'screen_icon' => $this->oProp->bIsAdmin ? FetchTweets_Commons::getPluginURL("/asset/image/screen_icon_32x32.png") : '', 'exclude_from_search' => !FetchTweets_Option::get(array('search', 'is_searchable')), 'capabilities' => array('publish_posts' => $_sCapability, 'edit_posts' => $_sCapability, 'edit_others_posts' => $_sCapability, 'delete_posts' => $_sCapability, 'delete_others_posts' => $_sCapability, 'read_private_posts' => $_sCapability, 'edit_post' => $_sCapability, 'delete_post' => $_sCapability, 'read_post' => $_sCapability))); $this->addTaxonomy(FetchTweets_Commons::TagSlug, array('labels' => $this->oProp->bIsAdmin ? $this->_getTaxonomyTagLabelArgumnents() : array(), 'show_ui' => true, 'show_tagcloud' => false, 'hierarchical' => false, 'show_admin_column' => true, 'show_in_nav_menus' => false, 'show_table_filter' => true, 'show_in_sidebar_menus' => true)); $_sCurrentPostTypeInAdmin = isset($GLOBALS['post_type']) ? $GLOBALS['post_type'] : (isset($_GET['post_type']) ? $_GET['post_type'] : ''); // For admin if ($_sCurrentPostTypeInAdmin == $this->oProp->sPostType && is_admin()) { $this->setAutoSave(false); $this->setAuthorTableFilter(true); add_filter('enter_title_here', array($this, '_replyToChangeTitleMetaBoxFieldLabel')); // add_filter( 'gettext', array( $this, 'changeTitleMetaBoxFieldLabel' ) ); add_action('edit_form_after_title', array($this, 'addTextAfterTitle')); } // add_filter( 'the_content', array( $this, '_replyToPreviewTweets' ) ); }
public function setUp() { $_sCapability = FetchTweets_Option::get(array('capabilities', 'setting_page_capability')); if ($_sCapability) { $this->setCapability($_sCapability); } $this->_setUpPages(); }