Skip to content

Commit

Permalink
Merge pull request #65 from BenjaminMedia/WILL-237/add-settings-field
Browse files Browse the repository at this point in the history
Will 237/add settings field
  • Loading branch information
jonastanz authored Mar 20, 2018
2 parents f260827 + 5afc8ee commit 874ba13
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Bonnier/WP/Cxense/Assets/Scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ public function add_head_tags()
$recs_tags = apply_filters('cxense_head_tags', []);

$this->recursive_get_meta_tag($recs_tags);

$this->persisted_query_id_tag();
}

private function persisted_query_id_tag()
{
if ($persisted_query_id = self::$settings->get_persisted_query_id()) {
echo '<meta name="cxense-persisted-query-id" content="' . $persisted_query_id . '"></meta>' . PHP_EOL;
}
}

private function recursive_get_meta_tag($recs_tags, $org_cxense_key = '')
Expand Down
5 changes: 5 additions & 0 deletions src/Bonnier/WP/Cxense/Settings/SettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ public function get_widget_ids($locale = null)
return $this->get_setting_value(WidgetSettings::SETTING_KEY, $locale) ?: [];
}

public function get_persisted_query_id($locale = null)
{
return $this->get_setting_value('persisted_query_id', $locale) ?: '';
}

public function get_searchable_taxonomies($locale = null)
{ // Flip array so the sort order number becomes the key ie. [1 => 'category', 2 => 'post_tag']
$taxonomyOrder = array_flip($this->get_setting_value(CustomTaxonomiesSettings::SETTING_KEY_ORDER, $locale)) ?: [];
Expand Down
2 changes: 1 addition & 1 deletion wp-cxense.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: WP cXense
* Version: 1.2.10
* Version: 1.2.11
* Plugin URI: https://github.com/BenjaminMedia/wp-cxense
* Description: This plugin integrates your site with cXense by adding meta tags and calling the cXense api
* Author: Bonnier - Alf Henderson
Expand Down

0 comments on commit 874ba13

Please sign in to comment.