Insert Pages - Version 2.7

Version Description

  • Fix: Prevent Insert Pages from breaking tinymce if wp_editor() is called outside of an admin context.
Download this release

Release Info

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

Code changes from version 2.6 to 2.7

Files changed (2) hide show
  1. insert-pages.php +10 -1
  2. readme.txt +3 -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.6
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
@@ -247,6 +247,15 @@ if ( !class_exists( 'InsertPagesPlugin' ) ) {
247
  * @since 3.1.0
248
  */
249
  function insertPages_wp_tinymce_dialog() {
 
 
 
 
 
 
 
 
 
250
  $options_panel_visible = '1' == get_user_setting( 'wplink', '0' ) ? ' options-panel-visible' : '';
251
 
252
  // display: none is required here, see #WP27605
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
  */
247
  * @since 3.1.0
248
  */
249
  function insertPages_wp_tinymce_dialog() {
250
+ // If wp_editor() is being called outside of an admin context,
251
+ // required dependencies for Insert Pages will be missing (e.g.,
252
+ // wp-admin/includes/template.php will not be loaded, admin_head
253
+ // action will not be fired). If that's the case, just skip loading
254
+ // the Insert Pages tinymce button.
255
+ if ( ! is_admin() || ! function_exists( 'page_template_dropdown' ) ) {
256
+ return;
257
+ }
258
+
259
  $options_panel_visible = '1' == get_user_setting( 'wplink', '0' ) ? ' options-panel-visible' : '';
260
 
261
  // display: none is required here, see #WP27605
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
  = 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
 
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
+
92
  = 2.6 =
93
  * 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.
94