diff --git a/readme.txt b/readme.txt index 652e7361dadcdd54a92fb96913f2a62d5e32fd9c..76b010ce5261e2f665deacaefed7e6e0dd7898de 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: ethitter, thinkoomph Donate link: http://www.thinkoomph.com/plugins-modules/view-all-posts-pages/ Tags: view all, pages, paged, paged post, multipage, single view, single page, wp_link_pages, nextpage, next page, quicktag Requires at least: 3.2.1 -Tested up to: 3.6 -Stable tag: 0.8.1 +Tested up to: 3.8 +Stable tag: 0.9 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -45,6 +45,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an == Changelog == += 0.9 = +* Move conditional registration of some filters to `init`, both to ensure external code can interact with filters and to avoid PHP notices. + = 0.8.1 = * Correct translation implementation issue introduced in v0.8. @@ -89,6 +92,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an == Upgrade Notice == += 0.9 = +Recommended update for anyone hoping to use plugin's filters to modify its behaviour. + = 0.8.1 = Recommended upgrade for anyone translating plugin's interface. diff --git a/view-all-posts-pages.php b/view-all-posts-pages.php index 11e18a1df3fb14e63a050c8c506057c7cf847381..68a38c2f4e3d32ce049f68fde392185513abe0ca 100644 --- a/view-all-posts-pages.php +++ b/view-all-posts-pages.php @@ -4,7 +4,7 @@ Plugin Name: View All Post's Pages Plugin URI: http://www.thinkoomph.com/plugins-modules/view-all-posts-pages/ Description: Provides a "view all" (single page) option for posts, pages, and custom post types paged using WordPress' <a href="http://codex.wordpress.org/Write_Post_SubPanel#Quicktags" target="_blank"><code><!--nextpage--></code> Quicktag</a> (multipage posts). Author: Erick Hitter & Oomph, Inc. -Version: 0.8.1 +Version: 0.9 Author URI: http://www.thinkoomph.com/ Text Domain: view_all_posts_pages @@ -67,10 +67,6 @@ class view_all_posts_pages { * * @uses register_deactivation_hook * @uses add_action - * @uses add_filter - * @uses this::get_options - * @uses apply_filters - * @uses get_option * @return null */ private function setup() { @@ -83,17 +79,6 @@ class view_all_posts_pages { add_action( 'redirect_canonical', array( $this, 'filter_redirect_canonical' ) ); add_action( 'the_post', array( $this, 'action_the_post' ), 5 ); - - $options = $this->get_options(); - - if ( array_key_exists( 'wlp', $options ) && true === $options[ 'wlp' ] ) - add_filter( 'wp_link_pages_args', array( $this, 'filter_wp_link_pages_args_early' ), 0 ); - - if ( $options[ 'link' ] ) - add_filter( 'the_content', array( $this, 'filter_the_content_auto' ), $options[ 'link_priority' ] ); - - if ( apply_filters( 'vapp_display_rewrite_rules_notice', true ) && ! get_option( $this->notice_key ) ) - add_action( 'admin_notices', array( $this, 'action_admin_notices_activation' ) ); } /** @@ -143,6 +128,11 @@ class view_all_posts_pages { * * @global $wp_rewrite * @uses __ + * @uses this::get_options + * @uses add_filter + * @uses apply_filters + * @uses get_option + * @uses add_action * @uses add_rewrite_endpoint * @action init * @return null @@ -166,6 +156,18 @@ class view_all_posts_pages { 'link_priority' => 10, ); + // Register additional plugin actions if settings call for them. + $options = $this->get_options(); + + if ( array_key_exists( 'wlp', $options ) && true === $options[ 'wlp' ] ) + add_filter( 'wp_link_pages_args', array( $this, 'filter_wp_link_pages_args_early' ), 0 ); + + if ( $options[ 'link' ] ) + add_filter( 'the_content', array( $this, 'filter_the_content_auto' ), $options[ 'link_priority' ] ); + + if ( apply_filters( 'vapp_display_rewrite_rules_notice', true ) && ! get_option( $this->notice_key ) ) + add_action( 'admin_notices', array( $this, 'action_admin_notices_activation' ) ); + // Register rewrite endpoint, which handles most of our rewrite needs add_rewrite_endpoint( $this->query_var, EP_ALL );