Version Description
- Fix incorrect link in excerpt's 'Continue reading' link. Props @bogyo74 for discovering the bug!
- Fix empty id attribute rendering if no custom ID provided. Props @theschappy for finding and fixing this bug!
Download this release
Release Info
Developer | figureone |
Plugin | Insert Pages |
Version | 3.4.4 |
Comparing to | |
See all releases |
Code changes from version 3.4.3 to 3.4.4
- insert-pages.php +7 -2
- readme.txt +4 -0
insert-pages.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* Text Domain: insert-pages
|
8 |
* Domain Path: /languages
|
9 |
* License: GPL2
|
10 |
-
* Version: 3.4.
|
11 |
*
|
12 |
* @package insert-pages
|
13 |
*/
|
@@ -837,7 +837,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
|
|
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 |
|
@@ -910,7 +910,12 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
|
|
910 |
*
|
911 |
* @param string $more_string The string shown within the more link.
|
912 |
*/
|
|
|
|
|
|
|
913 |
$excerpt_more = apply_filters( 'excerpt_more', ' […]' );
|
|
|
|
|
914 |
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
|
915 |
}
|
916 |
/**
|
7 |
* Text Domain: insert-pages
|
8 |
* Domain Path: /languages
|
9 |
* License: GPL2
|
10 |
+
* Version: 3.4.4
|
11 |
*
|
12 |
* @package insert-pages
|
13 |
*/
|
837 |
* @return string Content to replace shortcode.
|
838 |
*/
|
839 |
public function insert_pages_wrap_content( $content, $posts, $attributes ) {
|
840 |
+
$maybe_id = isset( $attributes['id'] ) && strlen( $attributes['id'] ) > 0 ? ' 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 |
|
910 |
*
|
911 |
* @param string $more_string The string shown within the more link.
|
912 |
*/
|
913 |
+
global $post;
|
914 |
+
$old_post_id = $post->ID;
|
915 |
+
$post->ID = $post_id;
|
916 |
$excerpt_more = apply_filters( 'excerpt_more', ' […]' );
|
917 |
+
$post->ID = $old_post_id;
|
918 |
+
|
919 |
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
|
920 |
}
|
921 |
/**
|
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.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!
|
86 |
|
87 |
== Changelog ==
|
88 |
|
89 |
+
= 3.4.4 =
|
90 |
+
* Fix incorrect link in excerpt's 'Continue reading' link. Props @bogyo74 for discovering the bug!
|
91 |
+
* Fix empty id attribute rendering if no custom ID provided. Props @theschappy for finding and fixing this bug!
|
92 |
+
|
93 |
= 3.4.3 =
|
94 |
* 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!
|
95 |
* Fix for WPBakery Visual Composer inline styles in inserted pages. Props @Seb33300 for the pull request!
|