Insert Pages - Version 3.1.4

Version Description

  • Compatibility for for php versions lower than 5.3. Replace closure with create_function().
Download this release

Release Info

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

Code changes from version 3.1.3 to 3.1.4

Files changed (2) hide show
  1. insert-pages.php +5 -4
  2. readme.txt +3 -0
insert-pages.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Insert Pages
5
  Plugin URI: https://github.com/uhm-coe/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: 3.1.3
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
@@ -184,9 +184,10 @@ if ( !class_exists( 'InsertPagesPlugin' ) ) {
184
  if ( ! is_numeric( $attributes['page'] ) ) {
185
  // Get list of post types that can be inserted (page, post, custom
186
  // types), excluding builtin types (nav_menu_item, attachment).
187
- $insertable_post_types = array_filter( get_post_types(), function ( $type ) {
188
- return ! in_array( $type, array( 'nav_menu_item', 'attachment' ) );
189
- });
 
190
  $inserted_page = get_page_by_path( $attributes['page'], OBJECT, $insertable_post_types );
191
  $attributes['page'] = $inserted_page ? $inserted_page->ID : $attributes['page'];
192
  } else {
5
  Plugin URI: https://github.com/uhm-coe/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: 3.1.4
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
184
  if ( ! is_numeric( $attributes['page'] ) ) {
185
  // Get list of post types that can be inserted (page, post, custom
186
  // types), excluding builtin types (nav_menu_item, attachment).
187
+ $insertable_post_types = array_filter(
188
+ get_post_types(),
189
+ create_function( '$type', 'return ! in_array( $type, array( "nav_menu_item", "attachment" ) );' )
190
+ );
191
  $inserted_page = get_page_by_path( $attributes['page'], OBJECT, $insertable_post_types );
192
  $attributes['page'] = $inserted_page ? $inserted_page->ID : $attributes['page'];
193
  } else {
readme.txt CHANGED
@@ -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
  = 3.1.3 =
90
  * Prevent menu items and page attachments from being insertable; this fixes problems with inserting pages via slug when there is a menu item with the same slug as a page/post. Props @k7f7 for tracking this one down!
91
 
86
 
87
  == Changelog ==
88
 
89
+ = 3.1.4 =
90
+ * Compatibility for for php versions lower than 5.3. Replace closure with create_function().
91
+
92
  = 3.1.3 =
93
  * Prevent menu items and page attachments from being insertable; this fixes problems with inserting pages via slug when there is a menu item with the same slug as a page/post. Props @k7f7 for tracking this one down!
94