コード例 #1
0
 public static function flushRewriteRules()
 {
     if (self::$_bIsFlushed) {
         return;
     }
     flush_rewrite_rules();
     self::$_bIsFlushed = true;
 }
コード例 #2
0
 public function _replyToSetPageLoadInfoInFooter()
 {
     if (isset($_GET['page']) && $_GET['page']) {
         return;
     }
     if (AmazonAutoLinks_AdminPageFramework_WPUtility::getCurrentPostType() == $this->oProp->sPostType || AmazonAutoLinks_AdminPageFramework_WPUtility::isPostDefinitionPage($this->oProp->sPostType) || AmazonAutoLinks_AdminPageFramework_WPUtility::isCustomTaxonomyPage($this->oProp->sPostType)) {
         add_filter('update_footer', array($this, '_replyToGetPageLoadInfo'), 999);
     }
 }
コード例 #3
0
 public function getValue()
 {
     $_aParams = func_get_args();
     $_aDimensionalKeys = $_aParams + array(null, null);
     $_mDefault = null;
     if (is_array($_aDimensionalKeys[0])) {
         $_mDefault = $_aDimensionalKeys[1];
         $_aDimensionalKeys = $_aDimensionalKeys[0];
     }
     return AmazonAutoLinks_AdminPageFramework_WPUtility::getOption($this->oProp->sOptionKey, empty($_aParams) ? null : $_aDimensionalKeys, $_mDefault, $this->getSavedOptions() + $this->oForm->getDefaultFormValues());
 }
コード例 #4
0
 public function __construct($sPostType, $aArguments = array(), $sCallerPath = null, $sTextDomain = 'amazon-auto-links')
 {
     if (empty($sPostType)) {
         return;
     }
     $this->oProp = new AmazonAutoLinks_AdminPageFramework_Property_PostType($this, $this->_getCallerScriptPath($sCallerPath), get_class($this), 'publish_posts', $sTextDomain, 'post_type');
     $this->oProp->sPostType = AmazonAutoLinks_AdminPageFramework_WPUtility::sanitizeSlug($sPostType);
     $this->oProp->aPostTypeArgs = $aArguments;
     parent::__construct($this->oProp);
     $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}", $this);
 }
コード例 #5
0
 function start_el(&$sOutput, $oTerm, $iDepth = 0, $aArgs = array(), $iCurrentObjectID = 0)
 {
     $aArgs = $aArgs + array('_name_prefix' => null, '_input_id_prefix' => null, '_attributes' => array(), '_selected_items' => array(), 'taxonomy' => null, 'disabled' => null);
     $_iID = $oTerm->term_id;
     $_sTaxonomySlug = empty($aArgs['taxonomy']) ? 'category' : $aArgs['taxonomy'];
     $_sID = "{$aArgs['_input_id_prefix']}_{$_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_prefix']}[{$_iID}]", 'checked' => in_array($_iID, (array) $aArgs['_selected_items']) ? 'checked' : null) + $_aInputAttributes + array('class' => null);
     $_aInputAttributes['class'] .= ' apf_checkbox';
     $_aLiTagAttributes = array('id' => "list-{$_sID}", 'class' => 'category-list', 'title' => $oTerm->description);
     $sOutput .= "\n" . "<li " . AmazonAutoLinks_AdminPageFramework_WPUtility::getAttributes($_aLiTagAttributes) . ">" . "<label for='{$_sID}' class='taxonomy-checklist-label'>" . "<input value='0' type='hidden' name='" . $_aInputAttributes['name'] . "' class='apf_checkbox' />" . "<input " . AmazonAutoLinks_AdminPageFramework_WPUtility::getAttributes($_aInputAttributes) . " />" . esc_html(apply_filters('the_category', $oTerm->name)) . $_sPostCount . "</label>";
 }
コード例 #6
0
 public static function getOption($sOptionKey, $asKey = null, $vDefault = null)
 {
     return AmazonAutoLinks_AdminPageFramework_WPUtility::getOption($sOptionKey, $asKey, $vDefault);
 }