Insert Pages - Version 3.4.3

Version Description

  • Add 'id' shortcode param that sets the html id attribute on the wrapper element for an inserted page. Useful for anchor links. Props @Seb33300 for the suggestion!
  • Fix for WPBakery Visual Composer inline styles in inserted pages. Props @Seb33300 for the pull request!
Download this release

Release Info

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

Code changes from version 3.4.2 to 3.4.3

css/wpinsertpages.css CHANGED
@@ -142,7 +142,10 @@
142
  width: 77%;
143
  }
144
  #wp-insertpage label input#insertpage-extra-classes {
145
- width: 66%;
 
 
 
146
  }
147
 
148
  #wp-insertpage #insertpage-search-panel label span.search-label {
@@ -294,11 +297,15 @@
294
  }
295
 
296
  #wp-insertpage label input#insertpage-extra-classes {
297
- width: 62%;
 
 
 
 
298
  }
299
 
300
  #wp-insertpage-wrap.options-panel-visible {
301
- height: 555px;
302
  }
303
 
304
  #wp-insertpage-wrap .query-results {
@@ -328,7 +335,15 @@
328
  }
329
 
330
  #wp-insertpage label input#insertpage-extra-classes {
331
- width: 48%;
 
 
 
 
 
 
 
 
332
  }
333
 
334
  #wp-insertpage-wrap.options-panel-visible {
142
  width: 77%;
143
  }
144
  #wp-insertpage label input#insertpage-extra-classes {
145
+ width: 30%;
146
+ }
147
+ #wp-insertpage label input#insertpage-extra-id {
148
+ width: 30%;
149
  }
150
 
151
  #wp-insertpage #insertpage-search-panel label span.search-label {
297
  }
298
 
299
  #wp-insertpage label input#insertpage-extra-classes {
300
+ width: 28%;
301
+ }
302
+
303
+ #wp-insertpage label input#insertpage-extra-id {
304
+ width: 28%;
305
  }
306
 
307
  #wp-insertpage-wrap.options-panel-visible {
308
+ height: 575px;
309
  }
310
 
311
  #wp-insertpage-wrap .query-results {
335
  }
336
 
337
  #wp-insertpage label input#insertpage-extra-classes {
338
+ width: 21%;
339
+ }
340
+
341
+ #wp-insertpage label input#insertpage-extra-id {
342
+ width: 21%;
343
+ }
344
+
345
+ #wp-insertpage label input#insertpage-extra-querystring {
346
+ width: 75%;
347
  }
348
 
349
  #wp-insertpage-wrap.options-panel-visible {
insert-pages.php CHANGED
@@ -7,7 +7,7 @@
7
  * Text Domain: insert-pages
8
  * Domain Path: /languages
9
  * License: GPL2
10
- * Version: 3.4.2
11
  *
12
  * @package insert-pages
13
  */
@@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
 
32
  /**
33
  * Shortcode Format:
34
- * [insert page='{slug}|{id}' display='title|link|excerpt|excerpt-only|content|post-thumbnail|all|{custom-template.php}' class='any-classes']
35
  */
36
 
37
  if ( ! class_exists( 'InsertPagesPlugin' ) ) {
@@ -46,6 +46,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
46
  */
47
  protected $page_id;
48
 
 
49
  /**
50
  * Constructor.
51
  */
@@ -54,6 +55,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
54
  require_once dirname( __FILE__ ) . '/options.php';
55
  }
56
 
 
57
  /**
58
  * Getter for page_id.
59
  *
@@ -63,6 +65,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
63
  return $this->page_id;
64
  }
65
 
 
66
  /**
67
  * Setter for page_id.
68
  *
@@ -74,15 +77,18 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
74
  return $this->page_id;
75
  }
76
 
 
77
  /**
78
  * Action hook: WordPress 'init'.
79
  *
80
  * @return void
81
  */
82
  public function insert_pages_init() {
 
83
  add_shortcode( 'insert', array( $this, 'insert_pages_handle_shortcode_insert' ) );
84
  }
85
 
 
86
  /**
87
  * Action hook: WordPress 'admin_init'.
88
  *
@@ -136,12 +142,12 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
136
  add_filter( 'mce_buttons', array( $this, 'insert_pages_handle_filter_mce_buttons' ) );
137
  }
138
 
 
139
  load_plugin_textdomain(
140
  'insert-pages',
141
  false,
142
  plugin_basename( dirname( __FILE__ ) ) . '/languages'
143
  );
144
-
145
  }
146
 
147
 
@@ -160,6 +166,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
160
  'page' => '0',
161
  'display' => 'all',
162
  'class' => '',
 
163
  'inline' => false,
164
  'public' => false,
165
  'querystring' => '',
@@ -292,7 +299,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
292
 
293
  // If inserted page's status is private, don't show to anonymous users
294
  // unless 'public' option is set.
295
- if ( 'private' === $inserted_page->post_status && ! $attributes['public'] ) {
296
  $inserted_page = null;
297
  }
298
 
@@ -333,7 +340,8 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
333
  class_exists( 'FLBuilder' ) ||
334
  class_exists( 'SiteOrigin_Panels' ) ||
335
  class_exists( '\Elementor\Post_CSS_File' ) ||
336
- defined( 'VCV_VERSION' )
 
337
  ) {
338
  // If we're not in The Loop (i.e., global $post isn't assigned),
339
  // temporarily populate it with the post to be inserted so we can
@@ -388,6 +396,26 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
388
  }
389
  }
390
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  if ( is_null( $old_post_id ) ) {
392
  $post = null;
393
  } else {
@@ -579,7 +607,8 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
579
  class_exists( 'FLBuilder' ) ||
580
  class_exists( 'SiteOrigin_Panels' ) ||
581
  class_exists( '\Elementor\Post_CSS_File' ) ||
582
- defined( 'VCV_VERSION' )
 
583
  ) {
584
  // If we're not in The Loop (i.e., global $post isn't assigned),
585
  // temporarily populate it with the post to be inserted so we can
@@ -634,6 +663,26 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
634
  }
635
  }
636
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  if ( is_null( $old_post_id ) ) {
638
  $post = null;
639
  } else {
@@ -762,6 +811,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
762
  * page: Page ID or slug of page to be inserted.
763
  * display: Content to display from inserted page.
764
  * class: Extra classes to add to inserted page wrapper element.
 
765
  * inline: Boolean indicating wrapper element should be a span.
766
  * public: Boolean indicating anonymous users can see private inserted pages.
767
  * querystring: Extra querystring values provided to the custom template.
@@ -787,7 +837,8 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
787
  * @return string Content to replace shortcode.
788
  */
789
  public function insert_pages_wrap_content( $content, $posts, $attributes ) {
790
- return "<{$attributes['wrapper_tag']} data-post-id='{$attributes['page']}' class='insert-page insert-page-{$attributes['page']} {$attributes['class']}'>{$content}</{$attributes['wrapper_tag']}>";
 
791
  }
792
 
793
  /**
@@ -958,18 +1009,23 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
958
  </div>
959
  <div class="insertpage-extra">
960
  <label for="insertpage-extra-classes">
961
- <?php esc_html_e( 'Extra Classes', 'insert-pages' ); ?>
962
  <input id="insertpage-extra-classes" type="text" autocomplete="off" />
963
  </label>
 
 
 
 
964
  <label for="insertpage-extra-inline">
965
  <?php esc_html_e( 'Inline?', 'insert-pages' ); ?>
966
  <input id="insertpage-extra-inline" type="checkbox" />
967
  </label>
 
968
  <label for="insertpage-extra-querystring">
969
  <?php esc_html_e( 'Querystring', 'insert-pages' ); ?>
970
  <input id="insertpage-extra-querystring" type="text" autocomplete="off" />
971
  </label>
972
- <br>
973
  <label for="insertpage-extra-public">
974
  <input id="insertpage-extra-public" type="checkbox" />
975
  <?php esc_html_e( 'Anonymous users can see this inserted even if its status is private', 'insert-pages' ); ?>
7
  * Text Domain: insert-pages
8
  * Domain Path: /languages
9
  * License: GPL2
10
+ * Version: 3.4.3
11
  *
12
  * @package insert-pages
13
  */
31
 
32
  /**
33
  * Shortcode Format:
34
+ * [insert page='{slug}|{id}' display='title|link|excerpt|excerpt-only|content|post-thumbnail|all|{custom-template.php}' class='any-classes' id='any-id']
35
  */
36
 
37
  if ( ! class_exists( 'InsertPagesPlugin' ) ) {
46
  */
47
  protected $page_id;
48
 
49
+
50
  /**
51
  * Constructor.
52
  */
55
  require_once dirname( __FILE__ ) . '/options.php';
56
  }
57
 
58
+
59
  /**
60
  * Getter for page_id.
61
  *
65
  return $this->page_id;
66
  }
67
 
68
+
69
  /**
70
  * Setter for page_id.
71
  *
77
  return $this->page_id;
78
  }
79
 
80
+
81
  /**
82
  * Action hook: WordPress 'init'.
83
  *
84
  * @return void
85
  */
86
  public function insert_pages_init() {
87
+ // Register the [insert] shortcode.
88
  add_shortcode( 'insert', array( $this, 'insert_pages_handle_shortcode_insert' ) );
89
  }
90
 
91
+
92
  /**
93
  * Action hook: WordPress 'admin_init'.
94
  *
142
  add_filter( 'mce_buttons', array( $this, 'insert_pages_handle_filter_mce_buttons' ) );
143
  }
144
 
145
+ // Load the translations.
146
  load_plugin_textdomain(
147
  'insert-pages',
148
  false,
149
  plugin_basename( dirname( __FILE__ ) ) . '/languages'
150
  );
 
151
  }
152
 
153
 
166
  'page' => '0',
167
  'display' => 'all',
168
  'class' => '',
169
+ 'id' => '',
170
  'inline' => false,
171
  'public' => false,
172
  'querystring' => '',
299
 
300
  // If inserted page's status is private, don't show to anonymous users
301
  // unless 'public' option is set.
302
+ if ( is_object( $inserted_page ) && 'private' === $inserted_page->post_status && ! $attributes['public'] ) {
303
  $inserted_page = null;
304
  }
305
 
340
  class_exists( 'FLBuilder' ) ||
341
  class_exists( 'SiteOrigin_Panels' ) ||
342
  class_exists( '\Elementor\Post_CSS_File' ) ||
343
+ defined( 'VCV_VERSION' ) ||
344
+ defined( 'WPB_VC_VERSION' )
345
  ) {
346
  // If we're not in The Loop (i.e., global $post isn't assigned),
347
  // temporarily populate it with the post to be inserted so we can
396
  }
397
  }
398
 
399
+ // Visual Composer custom CSS
400
+ if ( defined( 'WPB_VC_VERSION' ) ) {
401
+ // Post custom CSS
402
+ $post_custom_css = get_post_meta( $inserted_page->ID, '_wpb_post_custom_css', true );
403
+ if ( ! empty( $post_custom_css ) ) {
404
+ $post_custom_css = strip_tags( $post_custom_css );
405
+ echo '<style type="text/css" data-type="vc_custom-css">';
406
+ echo $post_custom_css;
407
+ echo '</style>';
408
+ }
409
+ // Shortcodes custom CSS
410
+ $shortcodes_custom_css = get_post_meta( $inserted_page->ID, '_wpb_shortcodes_custom_css', true );
411
+ if ( ! empty( $shortcodes_custom_css ) ) {
412
+ $shortcodes_custom_css = strip_tags( $shortcodes_custom_css );
413
+ echo '<style type="text/css" data-type="vc_shortcodes-custom-css">';
414
+ echo $shortcodes_custom_css;
415
+ echo '</style>';
416
+ }
417
+ }
418
+
419
  if ( is_null( $old_post_id ) ) {
420
  $post = null;
421
  } else {
607
  class_exists( 'FLBuilder' ) ||
608
  class_exists( 'SiteOrigin_Panels' ) ||
609
  class_exists( '\Elementor\Post_CSS_File' ) ||
610
+ defined( 'VCV_VERSION' ) ||
611
+ defined( 'WPB_VC_VERSION' )
612
  ) {
613
  // If we're not in The Loop (i.e., global $post isn't assigned),
614
  // temporarily populate it with the post to be inserted so we can
663
  }
664
  }
665
 
666
+ // Visual Composer custom CSS
667
+ if ( defined( 'WPB_VC_VERSION' ) ) {
668
+ // Post custom CSS
669
+ $post_custom_css = get_post_meta( $inserted_page->ID, '_wpb_post_custom_css', true );
670
+ if ( ! empty( $post_custom_css ) ) {
671
+ $post_custom_css = strip_tags( $post_custom_css );
672
+ echo '<style type="text/css" data-type="vc_custom-css">';
673
+ echo $post_custom_css;
674
+ echo '</style>';
675
+ }
676
+ // Shortcodes custom CSS
677
+ $shortcodes_custom_css = get_post_meta( $inserted_page->ID, '_wpb_shortcodes_custom_css', true );
678
+ if ( ! empty( $shortcodes_custom_css ) ) {
679
+ $shortcodes_custom_css = strip_tags( $shortcodes_custom_css );
680
+ echo '<style type="text/css" data-type="vc_shortcodes-custom-css">';
681
+ echo $shortcodes_custom_css;
682
+ echo '</style>';
683
+ }
684
+ }
685
+
686
  if ( is_null( $old_post_id ) ) {
687
  $post = null;
688
  } else {
811
  * page: Page ID or slug of page to be inserted.
812
  * display: Content to display from inserted page.
813
  * class: Extra classes to add to inserted page wrapper element.
814
+ * id: Optional ID for the inserted page wrapper element.
815
  * inline: Boolean indicating wrapper element should be a span.
816
  * public: Boolean indicating anonymous users can see private inserted pages.
817
  * querystring: Extra querystring values provided to the custom template.
837
  * @return string Content to replace shortcode.
838
  */
839
  public function insert_pages_wrap_content( $content, $posts, $attributes ) {
840
+ $maybe_id = isset( $attributes['id'] ) ? ' id="' . esc_attr( $attributes['id'] ) . '"' : '';
841
+ return "<{$attributes['wrapper_tag']} data-post-id='{$attributes['page']}' class='insert-page insert-page-{$attributes['page']} {$attributes['class']}'$maybe_id>{$content}</{$attributes['wrapper_tag']}>";
842
  }
843
 
844
  /**
1009
  </div>
1010
  <div class="insertpage-extra">
1011
  <label for="insertpage-extra-classes">
1012
+ <?php esc_html_e( 'Extra Classes', 'insert-pages' ); ?>:
1013
  <input id="insertpage-extra-classes" type="text" autocomplete="off" />
1014
  </label>
1015
+ <label for="insertpage-extra-id">
1016
+ <?php esc_html_e( 'ID', 'insert-pages' ); ?>:
1017
+ <input id="insertpage-extra-id" type="text" autocomplete="off" />
1018
+ </label>
1019
  <label for="insertpage-extra-inline">
1020
  <?php esc_html_e( 'Inline?', 'insert-pages' ); ?>
1021
  <input id="insertpage-extra-inline" type="checkbox" />
1022
  </label>
1023
+ <br />
1024
  <label for="insertpage-extra-querystring">
1025
  <?php esc_html_e( 'Querystring', 'insert-pages' ); ?>
1026
  <input id="insertpage-extra-querystring" type="text" autocomplete="off" />
1027
  </label>
1028
+ <br />
1029
  <label for="insertpage-extra-public">
1030
  <input id="insertpage-extra-public" type="checkbox" />
1031
  <?php esc_html_e( 'Anonymous users can see this inserted even if its status is private', 'insert-pages' ); ?>
js/wpinsertpages.js CHANGED
@@ -27,6 +27,7 @@ var wpInsertPages;
27
  inputs.format = $( '#insertpage-format-select' );
28
  // Extra fields (wrapper classes, inline checkbox, "visible to all" checkbox)
29
  inputs.extraClasses = $( '#insertpage-extra-classes' );
 
30
  inputs.extraInline = $( '#insertpage-extra-inline' );
31
  inputs.extraPublic = $( '#insertpage-extra-public' );
32
  inputs.extraQuerystring = $( '#insertpage-extra-querystring' );
@@ -242,6 +243,15 @@ var wpInsertPages;
242
  inputs.extraClasses.val( '' );
243
  }
244
 
 
 
 
 
 
 
 
 
 
245
  // Update extra inline (i.e., use span instead of div for wrapper).
246
  regexp = /[\s]inline[\s\]]/;
247
  matches = regexp.exec( shortcode );
@@ -289,6 +299,7 @@ var wpInsertPages;
289
  inputs.format.change();
290
  inputs.template.val('all');
291
  inputs.extraClasses.val('');
 
292
  inputs.extraInline.attr( 'checked', false );
293
  inputs.search.val( '' );
294
  inputs.search.data( 'type', 'text' );
@@ -317,6 +328,7 @@ var wpInsertPages;
317
  pageID: inputs.pageID.val(),
318
  display: inputs.format.val()=='template' ? inputs.template.val() : inputs.format.val(),
319
  class: inputs.extraClasses.val(),
 
320
  inline: inputs.extraInline.is( ':checked' ),
321
  public: inputs.extraPublic.is( ':checked' ),
322
  querystring: inputs.extraQuerystring.val(),
@@ -350,6 +362,7 @@ var wpInsertPages;
350
  "page='" + attrs.page +"' " +
351
  "display='" + attrs.display + "'" +
352
  ( attrs['class'].length > 0 ? " class='" + attrs['class'] + "'" : "" ) +
 
353
  ( attrs.inline ? " inline" : "" ) +
354
  ( attrs.public ? " public" : "" ) +
355
  ( attrs.querystring ? " querystring='" +
27
  inputs.format = $( '#insertpage-format-select' );
28
  // Extra fields (wrapper classes, inline checkbox, "visible to all" checkbox)
29
  inputs.extraClasses = $( '#insertpage-extra-classes' );
30
+ inputs.extraID = $( '#insertpage-extra-id' );
31
  inputs.extraInline = $( '#insertpage-extra-inline' );
32
  inputs.extraPublic = $( '#insertpage-extra-public' );
33
  inputs.extraQuerystring = $( '#insertpage-extra-querystring' );
243
  inputs.extraClasses.val( '' );
244
  }
245
 
246
+ // Update extra ID.
247
+ regexp = /id=['"]([^['"]*)['"]/;
248
+ matches = regexp.exec( shortcode );
249
+ if ( matches && matches.length > 1 ) {
250
+ inputs.extraID.val( matches[1] );
251
+ } else {
252
+ inputs.extraID.val( '' );
253
+ }
254
+
255
  // Update extra inline (i.e., use span instead of div for wrapper).
256
  regexp = /[\s]inline[\s\]]/;
257
  matches = regexp.exec( shortcode );
299
  inputs.format.change();
300
  inputs.template.val('all');
301
  inputs.extraClasses.val('');
302
+ inputs.extraID.val( '' );
303
  inputs.extraInline.attr( 'checked', false );
304
  inputs.search.val( '' );
305
  inputs.search.data( 'type', 'text' );
328
  pageID: inputs.pageID.val(),
329
  display: inputs.format.val()=='template' ? inputs.template.val() : inputs.format.val(),
330
  class: inputs.extraClasses.val(),
331
+ id: inputs.extraID.val(),
332
  inline: inputs.extraInline.is( ':checked' ),
333
  public: inputs.extraPublic.is( ':checked' ),
334
  querystring: inputs.extraQuerystring.val(),
362
  "page='" + attrs.page +"' " +
363
  "display='" + attrs.display + "'" +
364
  ( attrs['class'].length > 0 ? " class='" + attrs['class'] + "'" : "" ) +
365
+ ( attrs['id'].length > 0 ? " id='" + attrs['id'] + "'" : "" ) +
366
  ( attrs.inline ? " inline" : "" ) +
367
  ( attrs.public ? " public" : "" ) +
368
  ( attrs.querystring ? " querystring='" +
languages/insert-pages.pot CHANGED
@@ -3,137 +3,161 @@ msgid ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Insert Pages\n"
6
- "POT-Creation-Date: 2016-11-14 10:04-1000\n"
7
  "PO-Revision-Date: 2016-11-14 10:04-1000\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 1.8.11\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-WPHeader: insert-pages.php\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
23
- #: insert-pages.php:77
24
  msgid "Update"
25
  msgstr ""
26
 
27
- #: insert-pages.php:78 insert-pages.php:637 widget.php:21
28
  msgid "Insert Page"
29
  msgstr ""
30
 
31
- #: insert-pages.php:79
32
  msgid "(no title)"
33
  msgstr ""
34
 
35
- #: insert-pages.php:80
36
  msgid "No matches found."
37
  msgstr ""
38
 
39
- #: insert-pages.php:570
 
 
 
 
40
  msgid "Insert page"
41
  msgstr ""
42
 
43
- #: insert-pages.php:577
44
  msgid "Search"
45
  msgstr ""
46
 
47
- #: insert-pages.php:589
48
  msgid "No search term specified. Showing recent items."
49
  msgstr ""
50
 
51
- #: insert-pages.php:596
52
  msgid "Options"
53
  msgstr ""
54
 
55
- #: insert-pages.php:600
56
  msgid "Slug or ID"
57
  msgstr ""
58
 
59
- #: insert-pages.php:607 widget.php:89
60
  msgid "Display"
61
  msgstr ""
62
 
63
- #: insert-pages.php:609 widget.php:91
64
  msgid "Title"
65
  msgstr ""
66
 
67
- #: insert-pages.php:610 widget.php:92
68
  msgid "Link"
69
  msgstr ""
70
 
71
- #: insert-pages.php:611
72
  msgid "Excerpt with title"
73
  msgstr ""
74
 
75
- #: insert-pages.php:612 widget.php:94
76
  msgid "Excerpt only (no title)"
77
  msgstr ""
78
 
79
- #: insert-pages.php:613 widget.php:95
80
  msgid "Content"
81
  msgstr ""
82
 
83
- #: insert-pages.php:614 widget.php:96
 
 
 
 
84
  msgid "All (includes custom fields)"
85
  msgstr ""
86
 
87
- #: insert-pages.php:615 widget.php:97
88
  msgid "Use a custom template"
89
  msgstr ""
90
 
91
- #: insert-pages.php:618 widget.php:100
92
  msgid "Default Template"
93
  msgstr ""
94
 
95
- #: insert-pages.php:625 widget.php:105
96
  msgid "Extra Classes"
97
  msgstr ""
98
 
99
- #: insert-pages.php:629 widget.php:110
 
 
 
 
100
  msgid "Inline?"
101
  msgstr ""
102
 
103
- #: insert-pages.php:640
 
 
 
 
 
 
 
 
104
  msgid "Cancel"
105
  msgstr ""
106
 
107
  #. Plugin Name of the plugin/theme
108
- #: options.php:13
109
  msgid "Insert Pages"
110
  msgstr ""
111
 
112
- #: options.php:19
113
  msgid "Shortcode format"
114
  msgstr ""
115
 
116
- #: options.php:26
117
  msgid "Wrapper for inserts"
118
  msgstr ""
119
 
120
- #: options.php:33
121
  msgid "Insert method"
122
  msgstr ""
123
 
124
- #: options.php:68
 
 
 
 
125
  msgid "You may override some default settings here."
126
  msgstr ""
127
 
128
- #: widget.php:21
129
  msgid "Insert a page into a widget area."
130
  msgstr ""
131
 
132
- #: widget.php:85
133
  msgid "Page/Post ID or Slug"
134
  msgstr ""
135
 
136
- #: widget.php:93
137
  msgid "Excerpt"
138
  msgstr ""
139
 
@@ -150,7 +174,3 @@ msgstr ""
150
  #. Author of the plugin/theme
151
  msgid "Paul Ryan"
152
  msgstr ""
153
-
154
- #. Author URI of the plugin/theme
155
- msgid "http://www.linkedin.com/in/paulrryan"
156
- msgstr ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Insert Pages\n"
6
+ "POT-Creation-Date: 2018-10-18 14:51-1000\n"
7
  "PO-Revision-Date: 2016-11-14 10:04-1000\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.12\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-WPHeader: insert-pages.php\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
19
+ "_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
23
+ #: insert-pages.php:115
24
  msgid "Update"
25
  msgstr ""
26
 
27
+ #: insert-pages.php:116 insert-pages.php:1038 widget.php:28
28
  msgid "Insert Page"
29
  msgstr ""
30
 
31
+ #: insert-pages.php:117
32
  msgid "(no title)"
33
  msgstr ""
34
 
35
+ #: insert-pages.php:118
36
  msgid "No matches found."
37
  msgstr ""
38
 
39
+ #: insert-pages.php:121
40
+ msgid "Private"
41
+ msgstr ""
42
+
43
+ #: insert-pages.php:956
44
  msgid "Insert page"
45
  msgstr ""
46
 
47
+ #: insert-pages.php:963
48
  msgid "Search"
49
  msgstr ""
50
 
51
+ #: insert-pages.php:975
52
  msgid "No search term specified. Showing recent items."
53
  msgstr ""
54
 
55
+ #: insert-pages.php:982
56
  msgid "Options"
57
  msgstr ""
58
 
59
+ #: insert-pages.php:986
60
  msgid "Slug or ID"
61
  msgstr ""
62
 
63
+ #: insert-pages.php:993 widget.php:108
64
  msgid "Display"
65
  msgstr ""
66
 
67
+ #: insert-pages.php:995 widget.php:110
68
  msgid "Title"
69
  msgstr ""
70
 
71
+ #: insert-pages.php:996 widget.php:111
72
  msgid "Link"
73
  msgstr ""
74
 
75
+ #: insert-pages.php:997
76
  msgid "Excerpt with title"
77
  msgstr ""
78
 
79
+ #: insert-pages.php:998 widget.php:113
80
  msgid "Excerpt only (no title)"
81
  msgstr ""
82
 
83
+ #: insert-pages.php:999 widget.php:114
84
  msgid "Content"
85
  msgstr ""
86
 
87
+ #: insert-pages.php:1000 widget.php:115
88
+ msgid "Post Thumbnail"
89
+ msgstr ""
90
+
91
+ #: insert-pages.php:1001 widget.php:116
92
  msgid "All (includes custom fields)"
93
  msgstr ""
94
 
95
+ #: insert-pages.php:1002 widget.php:117
96
  msgid "Use a custom template"
97
  msgstr ""
98
 
99
+ #: insert-pages.php:1005 widget.php:120
100
  msgid "Default Template"
101
  msgstr ""
102
 
103
+ #: insert-pages.php:1012 widget.php:127
104
  msgid "Extra Classes"
105
  msgstr ""
106
 
107
+ #: insert-pages.php:1016 widget.php:131
108
+ msgid "ID"
109
+ msgstr ""
110
+
111
+ #: insert-pages.php:1020 widget.php:136
112
  msgid "Inline?"
113
  msgstr ""
114
 
115
+ #: insert-pages.php:1025 widget.php:139
116
+ msgid "Querystring"
117
+ msgstr ""
118
+
119
+ #: insert-pages.php:1031 widget.php:144
120
+ msgid "Anonymous users can see this inserted even if its status is private"
121
+ msgstr ""
122
+
123
+ #: insert-pages.php:1041
124
  msgid "Cancel"
125
  msgstr ""
126
 
127
  #. Plugin Name of the plugin/theme
128
+ #: options.php:27
129
  msgid "Insert Pages"
130
  msgstr ""
131
 
132
+ #: options.php:33
133
  msgid "Shortcode format"
134
  msgstr ""
135
 
136
+ #: options.php:40
137
  msgid "Wrapper for inserts"
138
  msgstr ""
139
 
140
+ #: options.php:47
141
  msgid "Insert method"
142
  msgstr ""
143
 
144
+ #: options.php:54
145
+ msgid "TinyMCE filter"
146
+ msgstr ""
147
+
148
+ #: options.php:108
149
  msgid "You may override some default settings here."
150
  msgstr ""
151
 
152
+ #: widget.php:28
153
  msgid "Insert a page into a widget area."
154
  msgstr ""
155
 
156
+ #: widget.php:104
157
  msgid "Page/Post ID or Slug"
158
  msgstr ""
159
 
160
+ #: widget.php:112
161
  msgid "Excerpt"
162
  msgstr ""
163
 
174
  #. Author of the plugin/theme
175
  msgid "Paul Ryan"
176
  msgstr ""
 
 
 
 
options.php CHANGED
@@ -80,6 +80,13 @@ function wpip_set_defaults() {
80
 
81
  if ( ! array_key_exists( 'wpip_insert_method', $options ) ) {
82
  $options['wpip_insert_method'] = 'legacy';
 
 
 
 
 
 
 
83
  }
84
 
85
  if ( ! array_key_exists( 'wpip_tinymce_filter', $options ) ) {
@@ -164,7 +171,7 @@ function wpip_insert_method_render() {
164
  }
165
  ?>
166
  <input type='radio' name='wpip_settings[wpip_insert_method]' <?php checked( $options['wpip_insert_method'], 'legacy' ); ?> id="wpip_insert_method_legacy" value='legacy'><label for="wpip_insert_method_legacy">Use legacy method (compatible with <a href="https://wordpress.org/plugins/beaver-builder-lite-version/" target="_blank">Beaver Builder</a> and <a href="https://wordpress.org/plugins/siteorigin-panels/" target="_blank">Page Builder by SiteOrigin</a>, but less efficient). </label><br />
167
- <input type='radio' name='wpip_settings[wpip_insert_method]' <?php checked( $options['wpip_insert_method'], 'normal' ); ?> id="wpip_insert_method_normal" value='normal'><label for="wpip_insert_method_normal">Use normal method (more compatible with other plugins, and more efficient).</label><br />
168
  <small><em>The legacy method uses <a href="https://codex.wordpress.org/Function_Reference/query_posts" target="_blank">query_posts()</a>, which the Codex cautions against using. However, to recreate the exact state that many page builder plugins are expecting, the Main Loop has to be replaced with the inserted page while it is being rendered. The normal method, on the other hand, just uses <a href="https://developer.wordpress.org/reference/functions/get_post/" target="_blank">get_post()</a>.</em></small>
169
  <?php
170
  }
80
 
81
  if ( ! array_key_exists( 'wpip_insert_method', $options ) ) {
82
  $options['wpip_insert_method'] = 'legacy';
83
+
84
+ // Set default to 'normal' if gutenberg plugin is enabled (legacy insert
85
+ // method will cause the gutenberg editor to load only the inserted page if
86
+ // an insert page shortcode exists in a Shortcode block anywhere on the page.
87
+ if ( function_exists( 'gutenberg_init' ) ) {
88
+ $options['wpip_insert_method'] = 'normal';
89
+ }
90
  }
91
 
92
  if ( ! array_key_exists( 'wpip_tinymce_filter', $options ) ) {
171
  }
172
  ?>
173
  <input type='radio' name='wpip_settings[wpip_insert_method]' <?php checked( $options['wpip_insert_method'], 'legacy' ); ?> id="wpip_insert_method_legacy" value='legacy'><label for="wpip_insert_method_legacy">Use legacy method (compatible with <a href="https://wordpress.org/plugins/beaver-builder-lite-version/" target="_blank">Beaver Builder</a> and <a href="https://wordpress.org/plugins/siteorigin-panels/" target="_blank">Page Builder by SiteOrigin</a>, but less efficient). </label><br />
174
+ <input type='radio' name='wpip_settings[wpip_insert_method]' <?php checked( $options['wpip_insert_method'], 'normal' ); ?> id="wpip_insert_method_normal" value='normal'><label for="wpip_insert_method_normal">Use normal method (more compatible with other plugins, and more efficient). Compatible with Gutenberg.</label><br />
175
  <small><em>The legacy method uses <a href="https://codex.wordpress.org/Function_Reference/query_posts" target="_blank">query_posts()</a>, which the Codex cautions against using. However, to recreate the exact state that many page builder plugins are expecting, the Main Loop has to be replaced with the inserted page while it is being rendered. The normal method, on the other hand, just uses <a href="https://developer.wordpress.org/reference/functions/get_post/" target="_blank">get_post()</a>.</em></small>
176
  <?php
177
  }
readme.txt CHANGED
@@ -86,6 +86,10 @@ Just one! The plugin prevents you from embedding a page in itself, but you can t
86
 
87
  == Changelog ==
88
 
 
 
 
 
89
  = 3.4.2 =
90
  * Add 'public' shortcode param that lets private inserted pages be visible to anonymous users. Props @ahtcx for the suggestion.
91
  * Fix for inserted pages shown on BuddyPress profiles. Props @IdleWanderer for the report!
86
 
87
  == Changelog ==
88
 
89
+ = 3.4.3 =
90
+ * Add 'id' shortcode param that sets the html id attribute on the wrapper element for an inserted page. Useful for anchor links. Props @Seb33300 for the suggestion!
91
+ * Fix for WPBakery Visual Composer inline styles in inserted pages. Props @Seb33300 for the pull request!
92
+
93
  = 3.4.2 =
94
  * Add 'public' shortcode param that lets private inserted pages be visible to anonymous users. Props @ahtcx for the suggestion.
95
  * Fix for inserted pages shown on BuddyPress profiles. Props @IdleWanderer for the report!
widget.php CHANGED
@@ -61,6 +61,9 @@ class InsertPagesWidget extends WP_Widget {
61
  if ( array_key_exists( 'class', $instance ) ) {
62
  $atts['class'] = $instance['class'];
63
  }
 
 
 
64
  if ( array_key_exists( 'inline', $instance ) ) {
65
  $atts['inline'] = '1' === $instance['inline'];
66
  }
@@ -92,6 +95,7 @@ class InsertPagesWidget extends WP_Widget {
92
  'display' => 'link',
93
  'template' => '',
94
  'class' => '',
 
95
  'inline' => '',
96
  'querystring' => '',
97
  'public' => '',
@@ -123,6 +127,10 @@ class InsertPagesWidget extends WP_Widget {
123
  <label for="<?php echo esc_attr( $this->get_field_id( 'class' ) ); ?>"><?php esc_html_e( 'Extra Classes', 'insert-pages' ); ?>:</label>
124
  <input type="text" class="widefat" autocomplete="off" name="<?php echo esc_attr( $this->get_field_name( 'class' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'class' ) ); ?>" value="<?php echo esc_attr( $instance['class'] ); ?>" />
125
  </p>
 
 
 
 
126
  <p>
127
  <input class="checkbox" type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'inline' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'inline' ) ); ?>" value="1" <?php checked( $instance['inline'], '1' ); ?> />
128
  <label for="<?php echo esc_attr( $this->get_field_id( 'inline' ) ); ?>"><?php esc_html_e( 'Inline?', 'insert-pages' ); ?></label>
@@ -151,6 +159,7 @@ class InsertPagesWidget extends WP_Widget {
151
  $instance['display'] = array_key_exists( 'display', $new_instance ) ? strip_tags( $new_instance['display'] ) : '';
152
  $instance['template'] = array_key_exists( 'template', $new_instance ) ? strip_tags( $new_instance['template'] ) : '';
153
  $instance['class'] = array_key_exists( 'class', $new_instance ) ? strip_tags( $new_instance['class'] ) : '';
 
154
  $instance['inline'] = array_key_exists( 'inline', $new_instance ) ? strip_tags( $new_instance['inline'] ) : '';
155
  $instance['querystring'] = array_key_exists( 'querystring', $new_instance ) ? strip_tags( $new_instance['querystring'] ) : '';
156
  $instance['public'] = array_key_exists( 'public', $new_instance ) ? strip_tags( $new_instance['public'] ) : '';
61
  if ( array_key_exists( 'class', $instance ) ) {
62
  $atts['class'] = $instance['class'];
63
  }
64
+ if ( array_key_exists( 'id', $instance ) ) {
65
+ $atts['id'] = $instance['id'];
66
+ }
67
  if ( array_key_exists( 'inline', $instance ) ) {
68
  $atts['inline'] = '1' === $instance['inline'];
69
  }
95
  'display' => 'link',
96
  'template' => '',
97
  'class' => '',
98
+ 'id' => '',
99
  'inline' => '',
100
  'querystring' => '',
101
  'public' => '',
127
  <label for="<?php echo esc_attr( $this->get_field_id( 'class' ) ); ?>"><?php esc_html_e( 'Extra Classes', 'insert-pages' ); ?>:</label>
128
  <input type="text" class="widefat" autocomplete="off" name="<?php echo esc_attr( $this->get_field_name( 'class' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'class' ) ); ?>" value="<?php echo esc_attr( $instance['class'] ); ?>" />
129
  </p>
130
+ <p>
131
+ <label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php esc_html_e( 'ID', 'insert-pages' ); ?>:</label>
132
+ <input type="text" class="widefat" autocomplete="off" name="<?php echo esc_attr( $this->get_field_name( 'id' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>" value="<?php echo esc_attr( $instance['id'] ); ?>" />
133
+ </p>
134
  <p>
135
  <input class="checkbox" type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'inline' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'inline' ) ); ?>" value="1" <?php checked( $instance['inline'], '1' ); ?> />
136
  <label for="<?php echo esc_attr( $this->get_field_id( 'inline' ) ); ?>"><?php esc_html_e( 'Inline?', 'insert-pages' ); ?></label>
159
  $instance['display'] = array_key_exists( 'display', $new_instance ) ? strip_tags( $new_instance['display'] ) : '';
160
  $instance['template'] = array_key_exists( 'template', $new_instance ) ? strip_tags( $new_instance['template'] ) : '';
161
  $instance['class'] = array_key_exists( 'class', $new_instance ) ? strip_tags( $new_instance['class'] ) : '';
162
+ $instance['id'] = array_key_exists( 'id', $new_instance ) ? strip_tags( $new_instance['id'] ) : '';
163
  $instance['inline'] = array_key_exists( 'inline', $new_instance ) ? strip_tags( $new_instance['inline'] ) : '';
164
  $instance['querystring'] = array_key_exists( 'querystring', $new_instance ) ? strip_tags( $new_instance['querystring'] ) : '';
165
  $instance['public'] = array_key_exists( 'public', $new_instance ) ? strip_tags( $new_instance['public'] ) : '';