BUG: Unable to use hooks like s2_excerpt_length and s2_word_wrap | Troubleshooting Subscribe2 HTML | Support | Semper Plugins

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
BUG: Unable to use hooks like s2_excerpt_length and s2_word_wrap
November 18, 2016
5:02 pm
Avatar
Jeff
Member
Subscribe2
Forum Posts: 3
Member Since:
July 20, 2016
sp_UserOfflineSmall Offline

Hello,

In your plugin, I notice that you read the configuration filter values in the class-s2-core.php constructor:

function __construct() {
    $this->word_wrap = apply_filters( ‘s2_word_wrap’, 78 );
    …
}

In my environment, that constructor is called before my filter hooks are registered, too late to have an effect—could you hook those reads so they happen at the proper time?

function __construct() {
    add_action( ‘init’, array( $this, ‘init’ ), 11 );
}

function init() {
    $this->word_wrap = apply_filters( ‘s2_word_wrap’, 78 );
    …
}

November 19, 2016
4:41 am
Avatar
Matthew Robinson
UK
Admin
Forum Posts: 438
Member Since:
December 13, 2012
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

November 19, 2016
8:05 am
Avatar
Jeff
Member
Subscribe2
Forum Posts: 3
Member Since:
July 20, 2016
sp_UserOfflineSmall Offline

Hey Matt,

Excellent, thank you.

No custom code changes—I’m using PHP 7, powering WordPress via PHP-FPM / nginx in an Ubuntu Linux environment. I realize this isn’t “standard” WordPress, but a common one for production environments. I tried a number of ways to try and force my filter to register before that constructor executes, but the constructor always won.

November 19, 2016
8:40 am
Avatar
Matthew Robinson
UK
Admin
Forum Posts: 438
Member Since:
December 13, 2012
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

November 19, 2016
8:53 am
Avatar
Jeff
Member
Subscribe2
Forum Posts: 3
Member Since:
July 20, 2016
sp_UserOfflineSmall Offline

Sounds good Matt, I’ll be on the lookout. Appreciate it!

Forum Timezone: America/New_York

Most Users Ever Online: 964

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Member Stats:

Guest Posters: 33

Members: 18379

Moderators: 0

Admins: 8

Forum Stats:

Groups: 4

Forums: 28

Topics: 1779

Posts: 7538

Newest Members:

Sandra Kimball

Administrators: Michael TorbertPeter BayliesSupport TeamSteve MortiboyMatthew RobinsonSteve KlasenArnaud BroesAsh R

[i]
[i]
Skip to toolbar