Insert Pages - Version 3.1.2

Version Description

  • Fix for custom template dropdown not enabling when configuring the widget on the theme customizer page (customize.php). Props @aassouad for finding this!
Download this release

Release Info

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

Code changes from version 3.1.1 to 3.1.2

Files changed (3) hide show
  1. insert-pages.php +1 -1
  2. readme.txt +6 -3
  3. widget.php +12 -4
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.1
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
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.2
9
  Author URI: http://www.linkedin.com/in/paulrryan
10
  License: GPL2
11
  */
readme.txt CHANGED
@@ -2,16 +2,16 @@
2
  Contributors: figureone, the_magician
3
  Tags: insert, pages, shortcode, embed
4
  Requires at least: 3.0.1
5
- Tested up to: 4.4
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Insert Pages lets you embed any WordPress content (e.g., pages, posts, custom post types) into other WordPress content using the Shortcode API.
11
 
12
  == Description ==
13
 
14
- Insert Pages lets you embed any WordPress content (e.g., pages, posts, custom post types) into other WordPress content using the Shortcode API.
15
 
16
  The real power of Insert Pages comes when you start creating custom post types, either [programmatically in your theme](http://codex.wordpress.org/Post_Types), or using another plugin like [Custom Post Type UI](http://wordpress.org/plugins/custom-post-type-ui/). You can then abstract away common data types (like videos, quizzes, due dates) into their own custom post types, and then show those pieces of content within your normal pages and posts by Inserting them as a shortcode.
17
 
@@ -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.1 =
90
  * Fix: Add compatibility for PHP 5.2 in the widget registration code. See https://codex.wordpress.org/Widgets_API
91
 
2
  Contributors: figureone, the_magician
3
  Tags: insert, pages, shortcode, embed
4
  Requires at least: 3.0.1
5
+ Tested up to: 4.5.1
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Insert Pages lets you embed any WordPress content (e.g., pages, posts, custom post types) into other WordPress content using the Shortcode API. It also includes a widget for inserting pages into any widget area.
11
 
12
  == Description ==
13
 
14
+ Insert Pages lets you embed any WordPress content (e.g., pages, posts, custom post types) into other WordPress content using the Shortcode API. It also includes a widget for inserting pages into any widget area.
15
 
16
  The real power of Insert Pages comes when you start creating custom post types, either [programmatically in your theme](http://codex.wordpress.org/Post_Types), or using another plugin like [Custom Post Type UI](http://wordpress.org/plugins/custom-post-type-ui/). You can then abstract away common data types (like videos, quizzes, due dates) into their own custom post types, and then show those pieces of content within your normal pages and posts by Inserting them as a shortcode.
17
 
86
 
87
  == Changelog ==
88
 
89
+ = 3.1.2 =
90
+ * Fix for custom template dropdown not enabling when configuring the widget on the theme customizer page (customize.php). Props @aassouad for finding this!
91
+
92
  = 3.1.1 =
93
  * Fix: Add compatibility for PHP 5.2 in the widget registration code. See https://codex.wordpress.org/Widgets_API
94
 
widget.php CHANGED
@@ -11,15 +11,23 @@ class InsertPagesWidget extends WP_Widget {
11
  * Set up the widget.
12
  */
13
  public function __construct() {
14
- // Load admin javascript for Widget options.
15
- if ( is_admin() ) {
16
- wp_enqueue_script( 'insertpages_widget', plugins_url( '/js/widget.js', __FILE__ ), array( 'jquery' ), '20160105' );
17
- }
 
18
 
19
  // Call parent constructor to initialize the widget.
20
  parent::__construct( 'ipw', 'Insert Page', array( 'description' => 'Insert a page into a widget area.' ) );
21
  }
22
 
 
 
 
 
 
 
 
23
  /**
24
  * Output the content of the widget.
25
  *
11
  * Set up the widget.
12
  */
13
  public function __construct() {
14
+ // Load admin javascript for Widget options on admin page (widgets.php).
15
+ add_action( 'sidebar_admin_page', array( $this, 'widget_admin_js' ) );
16
+
17
+ // Load admin javascript for Widget options on theme customize page (customize.php)
18
+ add_action( 'customize_controls_enqueue_scripts', array( $this, 'widget_admin_js' ) );
19
 
20
  // Call parent constructor to initialize the widget.
21
  parent::__construct( 'ipw', 'Insert Page', array( 'description' => 'Insert a page into a widget area.' ) );
22
  }
23
 
24
+ /**
25
+ * Load javascript for interacting with the Insert Page widget.
26
+ */
27
+ function widget_admin_js() {
28
+ wp_enqueue_script( 'insertpages_widget', plugins_url( '/js/widget.js', __FILE__ ), array( 'jquery' ), '20160429' );
29
+ }
30
+
31
  /**
32
  * Output the content of the widget.
33
  *