public static function FlushRewriteRules()
 {
     $_bIsFlushed = isset(self::$_bIsFlushed) ? self::$_bIsFlushed : false;
     if ($_bIsFlushed) {
         return;
     }
     flush_rewrite_rules();
     self::$_bIsFlushed = true;
 }
 public function _replyToSetPageLoadInfoInFooter()
 {
     if (isset($_GET['page']) && $_GET['page']) {
         return;
     }
     if (FetchTweets_AdminPageFramework_WPUtility::getCurrentPostType() == $this->oProp->sPostType || FetchTweets_AdminPageFramework_WPUtility::isPostDefinitionPage($this->oProp->sPostType) || FetchTweets_AdminPageFramework_WPUtility::isCustomTaxonomyPage($this->oProp->sPostType)) {
         add_filter('update_footer', array($this, '_replyToGetPageLoadInfo'), 999);
     }
 }
 public function __construct($sPostType, $aArgs = array(), $sCallerPath = null, $sTextDomain = 'admin-page-framework')
 {
     if (empty($sPostType)) {
         return;
     }
     $this->oProp = new FetchTweets_AdminPageFramework_Property_PostType($this, $sCallerPath ? trim($sCallerPath) : (is_admin() && isset($GLOBALS['pagenow']) && in_array($GLOBALS['pagenow'], array('edit.php', 'post.php', 'post-new.php', 'plugins.php', 'tags.php', 'edit-tags.php')) ? FetchTweets_AdminPageFramework_Utility::getCallerScriptPath(__FILE__) : null), get_class($this), 'publish_posts', $sTextDomain, 'post_type');
     $this->oProp->sPostType = FetchTweets_AdminPageFramework_WPUtility::sanitizeSlug($sPostType);
     $this->oProp->aPostTypeArgs = $aArgs;
     parent::__construct($this->oProp);
     $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}", $this);
 }
 function start_el(&$sOutput, $oTerm, $iDepth = 0, $aArgs = array(), $iCurrentObjectID = 0)
 {
     $aArgs = $aArgs + array('name' => null, 'disabled' => null, 'selected' => array(), 'input_id' => null, 'attributes' => array(), 'taxonomy' => null);
     $_iID = $oTerm->term_id;
     $_sTaxonomySlug = empty($aArgs['taxonomy']) ? 'category' : $aArgs['taxonomy'];
     $_sID = "{$aArgs['input_id']}_{$_sTaxonomySlug}_{$_iID}";
     $_sPostCount = $aArgs['show_post_count'] ? " <span class='font-lighter'>(" . $oTerm->count . ")</span>" : '';
     $_aInputAttributes = isset($_aInputAttributes[$_iID]) ? $_aInputAttributes[$_iID] + $aArgs['attributes'] : $aArgs['attributes'];
     $_aInputAttributes = array('id' => $_sID, 'value' => 1, 'type' => 'checkbox', 'name' => "{$aArgs['name']}[{$_iID}]", 'checked' => in_array($_iID, (array) $aArgs['selected']) ? 'checked' : null) + $_aInputAttributes;
     $_aInputAttributes['class'] .= ' apf_checkbox';
     $_aLiTagAttributes = array('id' => "list-{$_sID}", 'class' => 'category-list', 'title' => $oTerm->description);
     $sOutput .= "\n" . "<li " . FetchTweets_AdminPageFramework_WPUtility::generateAttributes($_aLiTagAttributes) . ">" . "<label for='{$_sID}' class='taxonomy-checklist-label'>" . "<input value='0' type='hidden' name='{$aArgs['name']}[{$_iID}]' class='apf_checkbox' />" . "<input " . FetchTweets_AdminPageFramework_WPUtility::generateAttributes($_aInputAttributes) . " />" . esc_html(apply_filters('the_category', $oTerm->name)) . $_sPostCount . "</label>";
 }
 public static function getOption($sOptionKey, $asKey = null, $vDefault = null)
 {
     return FetchTweets_AdminPageFramework_WPUtility::getOption($sOptionKey, $asKey, $vDefault);
 }
예제 #6
0
 /**
  * Returns the specified option value.
  * 
  * @since       2.3.5
  */
 public static function get($asKey = null, $vDefault = null)
 {
     $_oOption = self::getInstance();
     // If the key is not set or false, return the entire option array.
     if (!$asKey) {
         return empty($_oOption->aOptions) ? $vDefault : $_oOption->aOptions;
     }
     // Now either the section ID or field ID is given.
     return FetchTweets_AdminPageFramework_WPUtility::getArrayValueByArrayKeys($_oOption->aOptions, array_values(FetchTweets_AdminPageFramework_WPUtility::getAsArray($asKey)), $vDefault);
 }
 public function getValue()
 {
     $_aDimensionalKeys = func_get_args();
     return FetchTweets_AdminPageFramework_WPUtility::getOption($this->oProp->sOptionKey, empty($_aDimensionalKeys) ? null : $_aDimensionalKeys, null, $this->getSavedOptions() + $this->oProp->getDefaultOptions($this->oForm->aFields));
 }
 protected function _getOptions()
 {
     return FetchTweets_AdminPageFramework_WPUtility::addAndApplyFilter($GLOBALS['aFetchTweets_AdminPageFramework']['aPageClasses'][$this->sClassName], 'options_' . $this->sClassName, $this->sOptionKey ? get_site_option($this->sOptionKey, array()) : array());
 }