Skip to content

Commit 606c880

Browse files
authored
Merge pull request #54 from rsingel/develop
Version 4.2
2 parents 6c92746 + 619f48c commit 606c880

4 files changed

Lines changed: 36 additions & 4 deletions

File tree

Contextly.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ class Contextly
2929
const WIDGET_SNIPPET_CLASS = 'ctx-module-container';
3030
const WIDGET_STORYLINE_CLASS = 'ctx-subscribe-container';
3131
const WIDGET_PERSONALIZATION_CLASS = 'ctx-personalization-container';
32+
const WIDGET_CHANNEL_CLASS = 'ctx-channel-container';
3233
const WIDGET_SIDERAIL_CLASS = 'ctx-siderail-container';
3334
const WIDGET_SOCIAL_CLASS = 'ctx-social-container';
3435

3536
const MAIN_MODULE_SHORT_CODE = 'contextly_main_module';
3637
const SL_MODULE_SHORT_CODE = 'contextly_sl_button';
3738
const PERSONALIZATION_MODULE_SHORT_CODE = 'contextly_personalization_button';
39+
const CHANNEL_MODULE_SHORT_CODE = 'contextly_channel_button';
3840
const ALL_BUTTONS_SHORT_CODE = 'contextly_all_buttons';
3941
const SIDERAIL_MODULE_SHORT_CODE = 'contextly_siderail';
4042
const SOCIAL_MODULE_SHORT_CODE = 'contextly_social';
@@ -237,6 +239,7 @@ public function initDefault() {
237239
add_shortcode('contextly_auto_sidebar', array( $this, 'prepareAutoSidebar' ) );
238240
add_shortcode(self::SL_MODULE_SHORT_CODE, array( $this, 'prepareSLButtonShortCode' ) );
239241
add_shortcode(self::PERSONALIZATION_MODULE_SHORT_CODE, array( $this, 'preparePersonalizationButtonShortCode' ) );
242+
add_shortcode(self::CHANNEL_MODULE_SHORT_CODE, array( $this, 'prepareChannelButtonShortCode' ) );
240243
add_shortcode(self::ALL_BUTTONS_SHORT_CODE, array( $this, 'prepareAllButtonsShortCode' ) );
241244
add_shortcode(self::SIDERAIL_MODULE_SHORT_CODE, array( $this, 'prepareSiderailShortCode' ) );
242245
add_shortcode(self::SOCIAL_MODULE_SHORT_CODE, array( $this, 'prepareSocialShortCode' ) );
@@ -1090,13 +1093,26 @@ public function preparePersonalizationButtonShortCode() {
10901093
return sprintf( "<div class='%s'></div>", $this->escapeClasses( $classes ) );
10911094
}
10921095

1096+
/**
1097+
* @return string
1098+
*/
1099+
public function prepareChannelButtonShortCode() {
1100+
$classes = array(
1101+
self::WIDGET_CHANNEL_CLASS,
1102+
self::SHORTCODE_PLACEMENT_CLASS,
1103+
self::CLEARFIX_CLASS,
1104+
);
1105+
return sprintf( "<div class='%s'></div>", $this->escapeClasses( $classes ) );
1106+
}
1107+
10931108
/**
10941109
* @return string
10951110
*/
10961111
public function prepareAllButtonsShortCode() {
10971112
$classes = array(
10981113
self::WIDGET_PERSONALIZATION_CLASS,
10991114
self::WIDGET_STORYLINE_CLASS,
1115+
self::WIDGET_CHANNEL_CLASS,
11001116
self::SHORTCODE_PLACEMENT_CLASS,
11011117
self::CLEARFIX_CLASS,
11021118
);

contextly-linker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin URI: http://contextly.com
55
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.
66
Author: Contextly
7-
Version: 4.1
7+
Version: 4.2
88
*/
99

1010
if ( ! defined( "CONTEXTLY_MODE" ) ) {
@@ -19,7 +19,7 @@
1919

2020
define ( "CONTEXTLY_HTTPS", $is_https );
2121
define ( "CONTEXTLY_PLUGIN_FILE", __FILE__ );
22-
define ( "CONTEXTLY_PLUGIN_VERSION", '4.1' );
22+
define ( "CONTEXTLY_PLUGIN_VERSION", '4.2' );
2323
define ( "CONTEXTLY_CDN_VERSION", 'branch' );
2424
if ( ! defined( "CONTEXTLY_MOD" ) ) {
2525
define ( "CONTEXTLY_MOD", false );

js/contextly-wordpress.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ $(window)
132132
'ctx_default_placement'
133133
],
134134
sharesWith: [
135-
'ctx-personalization-container'
135+
'ctx-personalization-container',
136+
'ctx-channel-container'
136137
]
137138
},
138139
'ctx-personalization-container': {
@@ -141,7 +142,17 @@ $(window)
141142
'ctx_default_placement'
142143
],
143144
sharesWith: [
144-
'ctx-subscribe-container'
145+
'ctx-subscribe-container',
146+
'ctx-channel-container'
147+
]
148+
},
149+
'ctx-channel-container': {
150+
placements: [
151+
'ctx_shortcode_placement'
152+
],
153+
sharesWith: [
154+
'ctx-subscribe-container',
155+
'ctx-personalization-container'
145156
]
146157
},
147158
'ctx-siderail-container': {

readme.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ If you just want to choose some items, copy and paste your main RSS feed into th
128128
== Changelog ==
129129

130130

131+
= 4.2 =
132+
133+
- Added support for new Channel button
134+
135+
131136
= 4.1 =
132137

133138
- Support for new Personalization module

0 commit comments

Comments
 (0)