function form($instance) { $menu_terms = get_terms('nav_menu', array('hide_empty' => false)); if (!$menu_terms) { echo '<p>' . sprintf(__('No menus have been created yet. <a href="%s">Create some</a>.', FOOTER_PUTTER_DOMAIN), admin_url('nav-menus.php')) . '</p>'; return; } $menus = array(); $menus[0] = 'Do not show a menu'; foreach ($menu_terms as $term) { $menus[$term->term_id] = $term->name; } $instance = wp_parse_args((array) $instance, $this->defaults); $this->print_form_field($instance, 'nav_menu', 'Select Footer Menu', 'select', $menus); $this->print_form_field($instance, 'center', 'Center Menu', 'checkbox'); $this->print_form_field($instance, 'two_lines', 'Spread Over Two Lines', 'checkbox'); $this->print_form_field($instance, 'show_copyright', 'Show Copyright', 'checkbox'); $this->print_form_field($instance, 'show_address', 'Show Address', 'checkbox'); $this->print_form_field($instance, 'show_telephone', 'Show Telephone number', 'checkbox'); $this->print_form_field($instance, 'show_email', 'Show Email Address', 'checkbox'); $this->print_form_field($instance, 'show_return', 'Show Return To Top Links', 'checkbox'); if (Footer_Credits::is_html5()) { $this->print_form_field($instance, 'use_microdata', 'Use HTML5 Microdata', 'checkbox'); } print <<<CUSTOM_CLASSES <h4>Custom Classes (Optional)</h4> <p>Add any custom CSS classes you want apply to the footer section content to change the font color and size.</p> <p>For your convenience we have defined 3 color classes <i>dark</i>, <i>light</i> and <i>white</i>, and 2 size classes, <i>small</i> and <i>tiny</i>. Feel free to use these alongside your own custom CSS classes.</p> CUSTOM_CLASSES; $this->print_form_field($instance, 'return_class', 'Return To Top', 'text', array(), array('size' => 10)); $this->print_form_field($instance, 'footer_class', 'Footer Credits', 'text', array(), array('size' => 10)); $this->print_form_field($instance, 'visibility', '<h4>Widget Visibility</h4>', 'radio', Footer_Credits::get_visibility_options(), array('separator' => '<br/>')); }
function owner_panel($terms) { $s = $this->fetch_text_field('owner', $terms['owner'], array('size' => 30)) . $this->fetch_text_field('country', $terms['country'], array('size' => 30)) . $this->fetch_form_field('address', $terms['address'], 'textarea', array(), array('cols' => 30, 'rows' => 5)); if (Footer_Credits::is_html5()) { return $s . '<p>Leave the above address field blank and fill in the various parts of the organization address below if you want to be able to use HTML5 microdata.</p>' . '<h4>Organization Address</h4>' . $this->fetch_text_field('street_address', $terms['street_address'], array('size' => 30)) . $this->fetch_text_field('locality', $terms['locality'], array('size' => 30)) . $this->fetch_text_field('region', $terms['region'], array('size' => 30)) . $this->fetch_text_field('postal_code', $terms['postal_code'], array('size' => 12)) . '<h4>Geographical Co-ordinates</h4>' . '<p>The geographical co-ordinates are optional and are visible only to the search engines.</p>' . $this->fetch_text_field('latitude', $terms['latitude'], array('size' => 12)) . $this->fetch_text_field('longitude', $terms['longitude'], array('size' => 12)) . $this->fetch_text_field('map', $terms['map'], array('size' => 30)); } else { return $s; } }
public static function init() { self::$is_html5 = function_exists('current_theme_supports') && current_theme_supports('html5'); self::theme_specific_defaults(); add_action('widgets_init', array(__CLASS__, 'register'), 20); add_filter('wp_nav_menu_items', array(__CLASS__, 'fix_home_link'), 10, 2); if (!is_admin()) { add_action('wp', array(__CLASS__, 'prepare')); } }
public static function owner_panel($post, $metabox) { $terms = $metabox['args']['options']['terms']; $tip1 = self::$tooltips->tip('owner'); $tip2 = self::$tooltips->tip('country'); $tip3 = self::$tooltips->tip('address'); $tip4 = self::$tooltips->tip('street_address'); $tip5 = self::$tooltips->tip('locality'); $tip6 = self::$tooltips->tip('region'); $tip7 = self::$tooltips->tip('postal_code'); $tip8 = self::$tooltips->tip('latitude'); $tip9 = self::$tooltips->tip('longitude'); $tip10 = self::$tooltips->tip('map'); print <<<OWNER_PANEL <label>{$tip1}</label><input type="text" name="owner" size="30" value="{$terms['owner']}" /><br/> <label>{$tip2}</label><input type="text" name="country" size="30" value="{$terms['country']}" /><br/> <label>{$tip3}</label><input type="text" name="address" size="80" value="{$terms['address']}" /><br/> OWNER_PANEL; if (Footer_Credits::is_html5()) { print <<<ADDRESS_DATA <p>Leave the above address field blank and fill in the various parts of the organization address below if you want to be able to use HTML5 microdata.</p> <h4>Organization Address</h4> <label>{$tip4}</label><input type="text" name="street_address" size="30" value="{$terms['street_address']}" /><br/> <label>{$tip5}</label><input type="text" name="locality" size="30" value="{$terms['locality']}" /><br/> <label>{$tip6}</label><input type="text" name="region" size="30" value="{$terms['region']}" /><br/> <label>{$tip7}</label><input type="text" name="postal_code" size="12" value="{$terms['postal_code']}" /><br/> <h4>Geographical Co-ordinates</h4> <p>The geographical co-ordinates are optional and are visible only to the search engines.</p> <label>{$tip8}</label><input type="text" name="latitude" size="12" value="{$terms['latitude']}" /><br/> <label>{$tip9}</label><input type="text" name="longitude" size="12" value="{$terms['longitude']}" /><br/> <label>{$tip10}</label><input type="text" name="map" size="30" value="{$terms['map']}" /><br/> ADDRESS_DATA; } }