public function __construct() { // Add additional action after saving (must be above parent constructor!) add_action('buzz-seo-settings-page-save-SettingsAdmin', array($this, 'rewritePermalinks'), 10, 2); // Allow seeing the results of our save immidiately add_action('buzz-seo-settings-page-save-SettingsAdmin', array($this, 'redirectAfterSave'), 99, 2); parent::__construct('SettingsAdmin'); if (isset($_GET['saved'])) { $this->setTalData('message', __("Settings saved.", "buzz-seo")); } // grab app $seo = \NextBuzz\SEO\App::getInstance(); // grapping every feature $features = $seo->getFeatures(); // check if its an array if (is_array($features) == false) { throw new \Exception(__("No Features available", "buzz-seo"), 401); } $optionList = array(); /* @var $class \NextBuzz\SEO\Features\BaseFeature */ foreach ($features as $key => $class) { if ($class->allowDisable()) { array_push($optionList, array('key' => $key, 'name' => ucfirst($class->name()), 'desc' => ucfirst($class->desc()), 'check' => isset($this->options['features'][$key]) && $this->options['features'][$key] === "1")); } } $this->setTalData(array('options' => $optionList, 'hasOptions' => count($optionList) > 0)); }
public function __construct($tplName) { parent::__construct('SettingsXML'); // Get all public post types $postTypes = get_post_types(array('public' => true), 'object'); $postTypeList = array(); foreach ($postTypes as $key => $postType) { array_push($postTypeList, array('key' => $key, 'name' => $postType->labels->name, 'check' => isset($this->options['posttypes'][$key]) && $this->options['posttypes'][$key] === "1")); } // Get all public taxonomies $taxonomies = get_taxonomies(array('public' => true), 'object'); $taxonomyList = array(); foreach ($taxonomies as $key => $postType) { array_push($taxonomyList, array('key' => $key, 'name' => $postType->labels->name, 'check' => isset($this->options['taxonomies'][$key]) && $this->options['taxonomies'][$key] === "1")); } // Output post types and taxonomies to TAL $this->setTalData(array('sitemapURL' => home_url('/sitemap.xml'), 'postTypes' => $postTypeList, 'taxonomies' => $taxonomyList)); }
public function __construct() { parent::__construct('SettingsStructuredData'); // Creative Works $tabs = array(array('name' => __('Creative works', 'buzz-seo'), 'items' => array('Article' => array('name' => __('Article', 'buzz-seo'), 'intro' => __('An article, such as a news article or piece of investigative report. Newspapers and magazines have articles of many different types and this is intended to cover them all.', 'buzz-seo'), 'addauthoroption' => true), 'BlogPosting' => array('name' => __('Blog posting', 'buzz-seo'), 'intro' => __('A blog post', 'buzz-seo'), 'addauthoroption' => true), 'Book' => array('name' => __('Book', 'buzz-seo'), 'intro' => __('A book', 'buzz-seo'), 'addauthoroption' => true), 'Code' => array('name' => __('Code', 'buzz-seo'), 'intro' => __('Computer programming source code. Example: Full (compile ready) solutions, code snippet samples, scripts, templates.', 'buzz-seo'), 'addauthoroption' => true), 'Game' => array('name' => __('Game', 'buzz-seo'), 'intro' => __('A game', 'buzz-seo'), 'addauthoroption' => true), 'Movie' => array('name' => __('Movie', 'buzz-seo'), 'intro' => __('A movie', 'buzz-seo'), 'addauthoroption' => true), 'MusicRecording' => array('name' => __('Music recording', 'buzz-seo'), 'intro' => __('A music recording (track), usually a single song.', 'buzz-seo'), 'addauthoroption' => true), 'Painting' => array('name' => __('Painting', 'buzz-seo'), 'intro' => __('A painting', 'buzz-seo'), 'addauthoroption' => true), 'Photograph' => array('name' => __('Photograph', 'buzz-seo'), 'intro' => __('A photograph', 'buzz-seo'), 'addauthoroption' => true), 'Recipe' => array('name' => __('Recipe', 'buzz-seo'), 'intro' => __('A recipe', 'buzz-seo'), 'addauthoroption' => true))), array('name' => __('Organizations', 'buzz-seo'), 'items' => array('Organization' => array('name' => __('Organization', 'buzz-seo'), 'intro' => __('An organization such as a school, NGO, corporation, club, etc.', 'buzz-seo'), 'addauthoroption' => false), 'Corporation' => array('name' => __('Corporation', 'buzz-seo'), 'intro' => __('A business corporation.', 'buzz-seo'), 'addauthoroption' => false), 'SportsOrganization' => array('name' => __('Sports organization', 'buzz-seo'), 'intro' => __('Represents the collection of all sports organizations, including sports teams, governing bodies, and sports associations.', 'buzz-seo'), 'addauthoroption' => false))), array('name' => __('Person', 'buzz-seo'), 'items' => array('Person' => array('name' => __('Person', 'buzz-seo'), 'intro' => __('A person (alive, dead, undead, or fictional).', 'buzz-seo'), 'addauthoroption' => false)))); // Get posttypes $postTypes = get_post_types(array('public' => true), 'objects'); foreach ($postTypes as &$postType) { // Unentitiy labels because default translations contain entities $postType->label = html_entity_decode($postType->label, ENT_QUOTES, "UTF-8"); } // Check if we don't want the boxes to show in code, we also don't want to enable jsonld $hidePostTypes = apply_filters('buzz-seo-disable-posttype', array()); foreach ($hidePostTypes as $pt) { unset($postTypes[$pt]); } $this->setTalData(array('postTypes' => $postTypes, 'tabs' => $tabs, 'websitePlaceholder' => get_bloginfo('name'))); }
public function __construct($tplName) { // Make sure eventclicks is an before constructen the parent $options = get_option('_settingsSettingsAnalytics', true); if (!is_array($options) || !isset($options['eventsclicks']) || !is_array($options['eventsclicks'])) { if (!is_array($options)) { $options = array(); } $options['eventsclicks'] = array(); // Make sure we re-retrieve the new settings wp_cache_delete('_settingsSettingsAnalytics'); update_option('_settingsSettingsAnalytics', $options); } if (isset($_POST) && isset($_POST['SettingsAnalytics']['eventsclicks'])) { foreach ($_POST['SettingsAnalytics']['eventsclicks'] as $k => $v) { if (empty($v['category']) || empty($v['action']) || empty($v['query'])) { unset($_POST['SettingsAnalytics']['eventsclicks'][$k]); } } } parent::__construct('SettingsAnalytics'); }
public function __construct() { parent::__construct('SettingsGeneral'); $availableSeps = array(array('item' => '-'), array('item' => '—'), array('item' => '·'), array('item' => '•'), array('item' => '*'), array('item' => '⋆'), array('item' => '|'), array('item' => '~'), array('item' => '«'), array('item' => '»'), array('item' => '<'), array('item' => '>')); foreach ($availableSeps as &$sep) { $sep['selected'] = $sep['item'] === $this->options['titleseparator']; } $this->setTalData('availableSeps', $availableSeps); // Get posttypes $postTypes = get_post_types(array('public' => true), 'objects'); foreach ($postTypes as &$postType) { // Unentitiy labels because default translations contain entities $postType->label = html_entity_decode($postType->label, ENT_QUOTES, "UTF-8"); } // Get taxonomies $taxonomyTypes = get_taxonomies(array('public' => true), 'objects'); foreach ($taxonomyTypes as &$taxonomy) { // Unentitiy labels because default translations contain entities $taxonomy->label = html_entity_decode($taxonomy->label, ENT_QUOTES, "UTF-8"); } $translate = \NextBuzz\SEO\Translate\Translate::factory(); $this->setTalData('siteIsMultilingual', $translate->siteIsMultilingual()); $this->setTalData(array('postTypes' => $postTypes, 'taxonomyTypes' => $taxonomyTypes, 'additionalArchives' => array('author' => array('name' => 'author', 'label' => __("Author", "buzz-seo")), 'date' => array('name' => 'date', 'label' => __("Date", "buzz-seo"))), 'archiveTranslation' => __("archive", "buzz-seo"))); }
public function __construct($tplName) { parent::__construct('SettingsCleanup'); }