function __construct($options = array()) { if (!largo_is_series_enabled() && !$this->isActiveHomepageLayout()) { add_action('init', array($this, 'unregister_HomepageSingleWithSeriesStories'), 105); } $defaults = array('name' => __('One big story and list of stories from the same series', 'largo'), 'type' => 'series', 'description' => __('A single story with full-width image treatment. Series stories appear to the right of the big story\'s headline and excerpt.', 'largo'), 'sidebars' => array(__('Home Bottom Left', 'largo'), __('Home Bottom Center', 'largo'), __('Home Bottom Right', 'largo')), 'prominenceTerms' => array(array('name' => __('Homepage Top Story', 'largo'), 'description' => __('If you are using a "Big story" homepage layout, add this label to a post to make it the top story on the homepage', 'largo'), 'slug' => 'top-story'))); $options = array_merge($defaults, $options); parent::__construct($options); }
function test_largo_is_series_enabled() { // Series option has not been touched yet (a new install) $result = largo_is_series_enabled(); $this->assertFalse($result); // Series option is to not enable series of_set_option('series_enabled', false); $result = largo_is_series_enabled(); $this->assertFalse($result); // Series option is to enable series of_set_option('series_enabled', 1); $result = largo_is_series_enabled(); $this->assertTrue($result); }
/** * If the option in Advanced Options is unchecked, unregister the "Series" taxonomy * * @uses largo_is_series_enabled * @since 0.4 */ function unregister_series_taxonomy() { if (!largo_is_series_enabled()) { register_taxonomy('series', array(), array('show_in_nav_menus' => false)); } }