Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Filter the_posts to preview_settings very early
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Sep 9, 2016
1 parent 35b6d70 commit 91b62a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion php/class-wp-customize-posts-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function add_preview_filters() {
add_action( 'pre_get_posts', array( $this, 'prepare_query_preview' ) );
add_filter( 'get_meta_sql', array( $this, 'filter_get_meta_sql_to_inject_customized_state' ), 10, 6 );
add_filter( 'posts_request', array( $this, 'filter_posts_request_to_inject_customized_state' ), 10, 2 );
add_filter( 'the_posts', array( $this, 'filter_the_posts_to_preview_settings' ), 1000, 2 );
add_filter( 'the_posts', array( $this, 'filter_the_posts_to_preview_settings' ), 1, 2 );
add_action( 'the_post', array( $this, 'preview_setup_postdata' ) );
add_filter( 'the_title', array( $this, 'filter_the_title' ), 1, 2 );
add_filter( 'get_post_metadata', array( $this, 'filter_get_post_meta_to_preview' ), 1000, 4 );
Expand Down
2 changes: 1 addition & 1 deletion tests/php/test-class-wp-customize-posts-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function test_add_preview_filters() {
$preview = new WP_Customize_Posts_Preview( $this->posts_component );
$this->assertTrue( $preview->add_preview_filters() );
$this->assertEquals( 10, has_action( 'the_post', array( $preview, 'preview_setup_postdata' ) ) );
$this->assertEquals( 1000, has_filter( 'the_posts', array( $preview, 'filter_the_posts_to_preview_settings' ) ) );
$this->assertEquals( 1, has_filter( 'the_posts', array( $preview, 'filter_the_posts_to_preview_settings' ) ) );
$this->assertEquals( 1, has_filter( 'the_title', array( $preview, 'filter_the_title' ) ) );
$this->assertEquals( 1000, has_filter( 'get_post_metadata', array( $preview, 'filter_get_post_meta_to_preview' ) ) );
$this->assertEquals( 10, has_filter( 'wp_setup_nav_menu_item', array( $preview, 'filter_nav_menu_item_to_set_url' ) ) );
Expand Down

0 comments on commit 91b62a8

Please sign in to comment.