/** * Called when the widget form element is rendered. */ public function form($aInstance) { // Avoid undefined index warnings. $_oDefaultTemplate = new FetchTweets_Template(); // pass nothing to get the default template. $aInstance = $aInstance + $this->_aStructure_FormElements; $aInstance['template'] = isset($aInstance['template']) ? $aInstance['template'] : $_oDefaultTemplate->getSlug(); $_aIDs = $this->_getFieldValues('id'); $_aNames = $this->_getFieldValues('name'); $this->echoFormElements($aInstance, $_aIDs, $_aNames); }
/** * Returns the default template slug. * @since 2.3.9 */ private function _getDefaultTemplateSlug() { $_oTemplate = new FetchTweets_Template(); return $_oTemplate->getSlug(); }
public function setUp() { $_oTemplate = new FetchTweets_Template(); // passing an empty value will make the object default template. $this->addSettingFields(array('field_id' => 'fetch_tweets_template', 'title' => __('Select Template', 'fetch-tweets'), 'description' => __('Set the default template for this rule. If a template is specified in a widget, the shortcode, or the function, this setting will be overridden.', 'fetch-tweets'), 'label' => $arr = FetchTweets_PluginUtility::getTemplateArrayForSelectLabel(), 'type' => 'select', 'default' => $_oTemplate->getSlug(), 'show_title_column' => false), array()); }