Changeset 925433
- Timestamp:
- 06/02/2014 11:45:28 PM (12 years ago)
- Location:
- advanced-excerpt
- Files:
-
- 22 added
- 4 edited
-
tags/4.2.2 (added)
-
tags/4.2.2/advanced-excerpt.php (added)
-
tags/4.2.2/asset (added)
-
tags/4.2.2/asset/css (added)
-
tags/4.2.2/asset/css/styles.css (added)
-
tags/4.2.2/asset/img (added)
-
tags/4.2.2/asset/img/wp-migrate-db-pro.jpg (added)
-
tags/4.2.2/asset/img/wp-migrate-db-pro@2x.jpg (added)
-
tags/4.2.2/asset/js (added)
-
tags/4.2.2/asset/js/advanced-excerpt.js (added)
-
tags/4.2.2/asset/js/advanced-excerpt.min.js (added)
-
tags/4.2.2/class (added)
-
tags/4.2.2/class/advanced-excerpt.php (added)
-
tags/4.2.2/functions (added)
-
tags/4.2.2/functions/functions.php (added)
-
tags/4.2.2/languages (added)
-
tags/4.2.2/languages/advanced-excerpt.pot (added)
-
tags/4.2.2/readme.txt (added)
-
tags/4.2.2/template (added)
-
tags/4.2.2/template/options.php (added)
-
tags/4.2.2/template/sidebar.php (added)
-
tags/4.2.2/uninstall.php (added)
-
trunk/advanced-excerpt.php (modified) (1 diff)
-
trunk/class/advanced-excerpt.php (modified) (3 diffs)
-
trunk/functions/functions.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-excerpt/trunk/advanced-excerpt.php
r922213 r925433 4 4 Plugin URI: http://wordpress.org/plugins/advanced-excerpt/ 5 5 Description: Control the appearance of WordPress post excerpts 6 Version: 4.2. 16 Version: 4.2.2 7 7 Author: Delicious Brains 8 8 Author URI: http://deliciousbrains.com/ 9 9 */ 10 10 11 $GLOBALS['advanced_excerpt_version'] = '4.2. 1';11 $GLOBALS['advanced_excerpt_version'] = '4.2.2'; 12 12 13 13 function advanced_excerpt_load_textdomain() { -
advanced-excerpt/trunk/class/advanced-excerpt.php
r922213 r925433 80 80 * 81 81 * WordPress default themes (and others) do not use the_excerpt() or get_the_excerpt() 82 * instead theyuse the_content(). As such, we also need to hook into the_content().83 * To ensure we're not changing the content of posts / pages we first check if is_singular().82 * and instead use the_content(). As such, we also need to hook into the_content(). 83 * To ensure we're not changing the content of single posts / pages we automatically exclude 'singular' page types. 84 84 */ 85 85 $page_types = $this->get_current_page_types(); … … 89 89 if ( !empty( $page_types ) && !empty( $page_type_matches ) ) return; 90 90 91 if ( 1 == $this->options['the_excerpt'] ) {91 if ( 1 == $this->options['the_excerpt'] ) { 92 92 remove_all_filters( 'get_the_excerpt' ); 93 93 add_filter( 'get_the_excerpt', array( $this, 'filter' ) ); 94 94 } 95 95 96 if ( 1 == $this->options['the_content'] ) {96 if ( 1 == $this->options['the_content'] ) { 97 97 add_filter( 'the_content', array( $this, 'filter' ) ); 98 98 } … … 219 219 $text = strip_shortcodes( $text ); 220 220 } 221 if( 1 == $this->options['the_content'] ) { 222 remove_filter( 'the_content', array( $this, 'filter' ) ); // prevent recursion 223 } 221 222 // prevent recursion on 'the_content' hook 223 $content_has_filter = false; 224 if ( has_filter( 'the_content', array( $this, 'filter' ) ) ) { 225 remove_filter( 'the_content', array( $this, 'filter' ) ); 226 $content_has_filter = true; 227 } 228 224 229 $text = apply_filters( 'the_content', $text ); 225 if( 1 == $this->options['the_content'] ) { 226 add_filter( 'the_content', array( $this, 'filter' ) ); // add our filter back in 230 231 // add our filter back in 232 if ( $content_has_filter ) { 233 add_filter( 'the_content', array( $this, 'filter' ) ); 227 234 } 228 235 -
advanced-excerpt/trunk/functions/functions.php
r922213 r925433 60 60 61 61 // Set temporary options 62 $advanced_excerpt->options = wp_parse_args( $args, $advanced_excerpt->default_options ); 62 $advanced_excerpt->options = wp_parse_args( $args, $advanced_excerpt->options ); 63 64 // Ensure our filter is hooked, regardless of the page type 65 if ( ! has_filter( 'get_the_excerpt', array( $advanced_excerpt, 'filter' ) ) ) { 66 remove_all_filters( 'get_the_excerpt' ); 67 add_filter( 'get_the_excerpt', array( $advanced_excerpt, 'filter' ) ); 68 } 63 69 64 70 if ( $get ) { … … 67 73 the_excerpt(); 68 74 } 75 76 // Reset the options back to their original state 77 $advanced_excerpt->load_options(); 69 78 } -
advanced-excerpt/trunk/readme.txt
r922217 r925433 5 5 Requires at least: 3.2 6 6 Tested up to: 3.9 7 Stable tag: 4.2. 17 Stable tag: 4.2.2 8 8 License: GPLv3 9 9 … … 97 97 == Changelog == 98 98 99 = 4.2.2 = 100 * Fix: The `the_advanced_excerpt()` function was not working on singular page types (pages / posts) 101 99 102 = 4.2.1 = 100 103 * Fix: Undefined index errors when using the `the_advanced_excerpt()` function
Note: See TracChangeset
for help on using the changeset viewer.