Insert Pages - Version 2.6

Version Description

  • Fix: Query data wasn't getting reset properly when viewing a category archive containing a post with an inserted page, causing date and author information in post footers in the twentyfifteen theme to show incorrect information. This has been resolved.
Download this release

Release Info

Developer figureone
Plugin Icon wp plugin Insert Pages
Version 2.6
Comparing to
See all releases

Code changes from version 2.5 to 2.6

Files changed (2) hide show
  1. insert-pages.php +3 -8
  2. readme.txt +4 -1
insert-pages.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Insert Pages
5
  Plugin URI: https://bitbucket.org/figureone/insert-pages
6
  Description: Insert Pages lets you embed any WordPress content (e.g., pages, posts, custom post types) into other WordPress content using the Shortcode API.
7
  Author: Paul Ryan
8
- Version: 2.5
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
@@ -139,10 +139,6 @@ if ( !class_exists( 'InsertPagesPlugin' ) ) {
139
  }
140
  }
141
 
142
- // Get page object from slug or id
143
- $temp_query = clone $wp_query; // we're starting a new loop within the main loop, so save the main query
144
- $temp_post = $wp_query->get_queried_object(); // see: http://codex.wordpress.org/The_Loop#Multiple_Loops_Example_2
145
-
146
  // Convert slugs to page IDs to standardize query_posts() lookup below.
147
  if ( ! is_numeric( $page ) ) {
148
  $page_object = get_page_by_path( $page, OBJECT, get_post_types() );
@@ -223,9 +219,8 @@ if ( !class_exists( 'InsertPagesPlugin' ) ) {
223
  $content = ob_get_contents(); // Save off output buffer
224
  ob_end_clean(); // End output buffering
225
  }
226
- wp_reset_postdata();
227
- $wp_query = clone $temp_query; // Restore main Loop's wp_query
228
- $post = $temp_post;
229
 
230
  $content = "<div data-post-id='$page' class='insert-page insert-page-$page $class'>$content</div>";
231
  return $content;
5
  Plugin URI: https://bitbucket.org/figureone/insert-pages
6
  Description: Insert Pages lets you embed any WordPress content (e.g., pages, posts, custom post types) into other WordPress content using the Shortcode API.
7
  Author: Paul Ryan
8
+ Version: 2.6
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
139
  }
140
  }
141
 
 
 
 
 
142
  // Convert slugs to page IDs to standardize query_posts() lookup below.
143
  if ( ! is_numeric( $page ) ) {
144
  $page_object = get_page_by_path( $page, OBJECT, get_post_types() );
219
  $content = ob_get_contents(); // Save off output buffer
220
  ob_end_clean(); // End output buffering
221
  }
222
+
223
+ wp_reset_query();
 
224
 
225
  $content = "<div data-post-id='$page' class='insert-page insert-page-$page $class'>$content</div>";
226
  return $content;
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: figureone, the_magician
3
  Tags: insert, pages, shortcode, embed
4
  Requires at least: 3.0.1
5
- Tested up to: 4.2.1
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -86,6 +86,9 @@ Just one! The plugin prevents you from embedding a page in itself, but you can t
86
 
87
  == Changelog ==
88
 
 
 
 
89
  = 2.5 =
90
  * Maintenance release: prevent infinite loops when using a custom template that doesn't call the_post().
91
 
2
  Contributors: figureone, the_magician
3
  Tags: insert, pages, shortcode, embed
4
  Requires at least: 3.0.1
5
+ Tested up to: 4.2.2
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
86
 
87
  == Changelog ==
88
 
89
+ = 2.6 =
90
+ * Fix: Query data wasn't getting reset properly when viewing a category archive containing a post with an inserted page, causing date and author information in post footers in the twentyfifteen theme to show incorrect information. This has been resolved.
91
+
92
  = 2.5 =
93
  * Maintenance release: prevent infinite loops when using a custom template that doesn't call the_post().
94