Skip to content

Commit

Permalink
Merge pull request #11 from athletics/apply-filters
Browse files Browse the repository at this point in the history
apply_filters for values in $javascript_array
  • Loading branch information
Andre Malan committed Nov 7, 2014
2 parents 2abe042 + 5e5508e commit b4641e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Plugin Name: SimpleReach Analytics
Plugin URI: https://github.com/simplereach/sranalytics_wordpress
Requires at least: 3.0
Tested up to: 4.0.0-beta-2
Stable tag: 0.1.3
Stable tag: 0.1.4

SimpleReach Analytics finds trending articles and gives publishers deep insights into their social traffic.

Expand All @@ -17,6 +17,9 @@ SimpleReach Analytics finds trending articles and gives publishers deep insights

== Changelog ==

= 0.1.4 =
* Add filters for values: title, url, date, channels, tags, and authors

= 0.1.3 =
* Updates for compatibility with WordPress VIP

Expand Down
16 changes: 8 additions & 8 deletions sranalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://www.simplereach.com/docs/wordpress-plugin/
Text Domain: sranalytics
Description: After installation, you must click '<a href='options-general.php?page=SimpleReach-Analytics'>Settings &rarr; SimpleReach Analytics</a>' to turn on the Analytics.
Version: 0.1.2
Version: 0.1.4
Author: SimpleReach
Author URI: https://www.simplereach.com
*/
Expand All @@ -26,7 +26,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

define( 'SRANALYTICS_PLUGIN_VERSION', '0.1.3' );
define( 'SRANALYTICS_PLUGIN_VERSION', '0.1.4' );

/**
* Insert analytics code onto the post page
Expand Down Expand Up @@ -161,12 +161,12 @@ function sranalytics_insert_js() {
'version' => SRANALYTICS_PLUGIN_VERSION,
'pid' => esc_js( $sranalytics_pid ),
'iframe' => esc_js( $sranalytics_disable_iframe_loading ),
'title' => esc_js( $title ),
'url' => esc_js( $canonical_url ),
'date' => esc_js( $published_date ),
'channels' => array_map( 'esc_js', $channels ),
'tags' => array_map( 'esc_js', $tags ),
'authors' => array_map( 'esc_js', $authors ),
'title' => esc_js( apply_filters( 'sranalytics_title', $title ) ),
'url' => esc_js( apply_filters( 'sranalytics_url', $canonical_url ) ),
'date' => esc_js( apply_filters( 'sranalytics_date', $published_date ) ),
'channels' => array_map( 'esc_js', apply_filters( 'sranalytics_channels', $channels ) ),
'tags' => array_map( 'esc_js', apply_filters( 'sranalytics_tags', $tags ) ),
'authors' => array_map( 'esc_js', apply_filters( 'sranalytics_authors', $authors ) ),
);

// Get the JS ready to go
Expand Down

0 comments on commit b4641e2

Please sign in to comment.