diff --git a/Contextly.php b/Contextly.php index 6853992..e21caea 100644 --- a/Contextly.php +++ b/Contextly.php @@ -29,12 +29,14 @@ class Contextly const WIDGET_SNIPPET_CLASS = 'ctx-module-container'; const WIDGET_STORYLINE_CLASS = 'ctx-subscribe-container'; const WIDGET_PERSONALIZATION_CLASS = 'ctx-personalization-container'; + const WIDGET_CHANNEL_CLASS = 'ctx-channel-container'; const WIDGET_SIDERAIL_CLASS = 'ctx-siderail-container'; const WIDGET_SOCIAL_CLASS = 'ctx-social-container'; const MAIN_MODULE_SHORT_CODE = 'contextly_main_module'; const SL_MODULE_SHORT_CODE = 'contextly_sl_button'; const PERSONALIZATION_MODULE_SHORT_CODE = 'contextly_personalization_button'; + const CHANNEL_MODULE_SHORT_CODE = 'contextly_channel_button'; const ALL_BUTTONS_SHORT_CODE = 'contextly_all_buttons'; const SIDERAIL_MODULE_SHORT_CODE = 'contextly_siderail'; const SOCIAL_MODULE_SHORT_CODE = 'contextly_social'; @@ -237,6 +239,7 @@ public function initDefault() { add_shortcode('contextly_auto_sidebar', array( $this, 'prepareAutoSidebar' ) ); add_shortcode(self::SL_MODULE_SHORT_CODE, array( $this, 'prepareSLButtonShortCode' ) ); add_shortcode(self::PERSONALIZATION_MODULE_SHORT_CODE, array( $this, 'preparePersonalizationButtonShortCode' ) ); + add_shortcode(self::CHANNEL_MODULE_SHORT_CODE, array( $this, 'prepareChannelButtonShortCode' ) ); add_shortcode(self::ALL_BUTTONS_SHORT_CODE, array( $this, 'prepareAllButtonsShortCode' ) ); add_shortcode(self::SIDERAIL_MODULE_SHORT_CODE, array( $this, 'prepareSiderailShortCode' ) ); add_shortcode(self::SOCIAL_MODULE_SHORT_CODE, array( $this, 'prepareSocialShortCode' ) ); @@ -1090,6 +1093,18 @@ public function preparePersonalizationButtonShortCode() { return sprintf( "
", $this->escapeClasses( $classes ) ); } + /** + * @return string + */ + public function prepareChannelButtonShortCode() { + $classes = array( + self::WIDGET_CHANNEL_CLASS, + self::SHORTCODE_PLACEMENT_CLASS, + self::CLEARFIX_CLASS, + ); + return sprintf( "
", $this->escapeClasses( $classes ) ); + } + /** * @return string */ @@ -1097,6 +1112,7 @@ public function prepareAllButtonsShortCode() { $classes = array( self::WIDGET_PERSONALIZATION_CLASS, self::WIDGET_STORYLINE_CLASS, + self::WIDGET_CHANNEL_CLASS, self::SHORTCODE_PLACEMENT_CLASS, self::CLEARFIX_CLASS, ); diff --git a/contextly-linker.php b/contextly-linker.php index 245f296..c388413 100644 --- a/contextly-linker.php +++ b/contextly-linker.php @@ -4,7 +4,7 @@ Plugin URI: http://contextly.com Description: Adds the Contextly content recommendation tool to your site. Contextly provides related, trending, evergreen and personalized recommendations to help your readers keep reading. Includes text, video and product recommendations to show off your best content. Author: Contextly -Version: 4.1 +Version: 4.2 */ if ( ! defined( "CONTEXTLY_MODE" ) ) { @@ -19,7 +19,7 @@ define ( "CONTEXTLY_HTTPS", $is_https ); define ( "CONTEXTLY_PLUGIN_FILE", __FILE__ ); -define ( "CONTEXTLY_PLUGIN_VERSION", '4.1' ); +define ( "CONTEXTLY_PLUGIN_VERSION", '4.2' ); define ( "CONTEXTLY_CDN_VERSION", 'branch' ); if ( ! defined( "CONTEXTLY_MOD" ) ) { define ( "CONTEXTLY_MOD", false ); diff --git a/js/contextly-wordpress.js b/js/contextly-wordpress.js index 814bbd0..ab8a2c2 100644 --- a/js/contextly-wordpress.js +++ b/js/contextly-wordpress.js @@ -132,7 +132,8 @@ $(window) 'ctx_default_placement' ], sharesWith: [ - 'ctx-personalization-container' + 'ctx-personalization-container', + 'ctx-channel-container' ] }, 'ctx-personalization-container': { @@ -141,7 +142,17 @@ $(window) 'ctx_default_placement' ], sharesWith: [ - 'ctx-subscribe-container' + 'ctx-subscribe-container', + 'ctx-channel-container' + ] + }, + 'ctx-channel-container': { + placements: [ + 'ctx_shortcode_placement' + ], + sharesWith: [ + 'ctx-subscribe-container', + 'ctx-personalization-container' ] }, 'ctx-siderail-container': { diff --git a/readme.txt b/readme.txt index f84e3c0..b19945b 100644 --- a/readme.txt +++ b/readme.txt @@ -128,6 +128,11 @@ If you just want to choose some items, copy and paste your main RSS feed into th == Changelog == += 4.2 = + +- Added support for new Channel button + + = 4.1 = - Support for new Personalization module