Skip to content

Commit

Permalink
move theme location to later hook
Browse files Browse the repository at this point in the history
  • Loading branch information
billerickson committed Feb 26, 2016
1 parent ffbdc05 commit 55ea370
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file, formatted via [this recommendation](http://keepachangelog.com/).

## [1.5.4] = 2016-02-26
### Changed
- Moved the theme location code to a later hook (template_redirect) so filterable in theme.

## [1.5.3] = 2016-01-28
### Added
- Display before/after content now supports all themes. First looks for Genesis and Theme Hook Alliance hooks, then falls back to 'the_content' filter (see #36)
Expand Down
4 changes: 2 additions & 2 deletions ea-share-count.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/jaredatch/EA-Share-Count
* Description: A lean plugin that leverages SharedCount.com API to quickly retrieve, cache, and display various social sharing counts.
* Author: Bill Erickson & Jared Atchison
* Version: 1.5.3
* Version: 1.5.4
*
* EA Share Count is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -51,7 +51,7 @@ final class EA_Share_Count {
* @since 1.0.0
* @var string
*/
private $version = '1.5.3';
private $version = '1.5.4';

/**
* Core instance
Expand Down
16 changes: 13 additions & 3 deletions includes/class-front.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@ class EA_Share_Count_Front {
public function __construct() {

// Load assets
add_action( 'template_redirect', array( $this, 'theme_location' ), 99 );
add_action( 'wp_enqueue_scripts', array( $this, 'header_assets' ), 9 );
add_action( 'wp_footer', array( $this, 'load_assets' ), 1 );
add_action( 'wp_footer', array( $this, 'email_modal' ), 50 );
add_action( 'wp_footer', array( $this, 'email_modal' ), 50 );

}

/**
* Add share buttons to theme locations
*
* @since 1.5.4
*/
function theme_location() {

// Genesis Hooks
if( 'genesis' == basename( TEMPLATEPATH ) ) {
Expand Down Expand Up @@ -98,9 +108,9 @@ public function __construct() {
} elseif( $locations['after']['filter'] ) {
add_filter( $locations['after']['filter'], array( $this, 'display_after_content_filter' ), $locations['after']['priority'] );
}

}

/**
* Enqueue the assets earlier if possible.
*
Expand Down

0 comments on commit 55ea370

Please sign in to comment.