Insert Pages - Version 2.7.1

Version Description

  • Add filter to show a message when an inserted page cannot be found. Example usage: function theme_init() { // Show a message in place of an inserted page if that page cannot be found. add_filter( 'insert_pages_not_found_message', function ( $content ) { return 'Page could not be found.'; } ); } add_action( 'init', 'theme_init' );
Download this release

Release Info

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

Code changes from version 2.7 to 2.7.1

Files changed (2) hide show
  1. insert-pages.php +8 -1
  2. readme.txt +8 -0
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.7
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
@@ -218,6 +218,13 @@ if ( !class_exists( 'InsertPagesPlugin' ) ) {
218
 
219
  $content = ob_get_contents(); // Save off output buffer
220
  ob_end_clean(); // End output buffering
 
 
 
 
 
 
 
221
  }
222
 
223
  wp_reset_query();
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.7.1
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
218
 
219
  $content = ob_get_contents(); // Save off output buffer
220
  ob_end_clean(); // End output buffering
221
+ } else {
222
+ /**
223
+ * Filter the html that should be displayed if an inserted page was not found.
224
+ *
225
+ * @param string $content html to be displayed. Defaults to an empty string.
226
+ */
227
+ $content = apply_filters( 'insert_pages_not_found_message', $content );
228
  }
229
 
230
  wp_reset_query();
readme.txt CHANGED
@@ -86,6 +86,14 @@ Just one! The plugin prevents you from embedding a page in itself, but you can t
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
 
 
89
  = 2.7 =
90
  * Fix: Prevent Insert Pages from breaking tinymce if wp_editor() is called outside of an admin context.
91
 
86
 
87
  == Changelog ==
88
 
89
+ = 2.7.1 =
90
+ * Add filter to show a message when an inserted page cannot be found. Example usage:
91
+ `function theme_init() {
92
+ // Show a message in place of an inserted page if that page cannot be found.
93
+ add_filter( 'insert_pages_not_found_message', function ( $content ) { return 'Page could not be found.'; } );
94
+ }
95
+ add_action( 'init', 'theme_init' );`
96
+
97
  = 2.7 =
98
  * Fix: Prevent Insert Pages from breaking tinymce if wp_editor() is called outside of an admin context.
99