PluginProbe
Advanced Excerpt / 4.2
Advanced Excerpt v4.2
trunk 0.2.2 3.0 3.1 4.0 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 All 30 releases
← All changes | functions/functions.php +2 -37 trunk4.2 View file →
@@ -49,48 +49,13 @@
49 49 unset( $args['finish_word'] );
50 50 unset( $args['finish_sentence'] );
51 51 }
52 52
53 - if ( ! empty( $args['allowed_tags'] ) || ! empty( $args['exclude_tags'] ) ) {
54 - if ( isset( $args['allowed_tags'] ) && ! in_array( '_all', (array) $args['allowed_tags'] ) ) {
55 - $args['allowed_tags_option'] = 'remove_all_tags_except';
56 - } else if ( ! isset( $args['allowed_tags'] ) ) {
57 - $args['allowed_tags_option'] = 'remove_all_tags_except';
58 - }
59 - }
60 -
61 53 // Set temporary options
62 - $advanced_excerpt->options = wp_parse_args( $args, $advanced_excerpt->options );
54 + $advanced_excerpt->options = $args;
63 55
64 - // Ensure our filter is hooked, regardless of the page type
65 - if ( ! has_filter( 'get_the_excerpt', array( $advanced_excerpt, 'filter_excerpt' ) ) ) {
66 - remove_all_filters( 'get_the_excerpt' );
67 - remove_all_filters( 'the_excerpt' );
68 - add_filter( 'get_the_excerpt', array( $advanced_excerpt, 'filter_excerpt' ) );
69 - }
70 -
71 56 if ( $get ) {
72 57 return get_the_excerpt();
73 58 } else {
74 59 the_excerpt();
75 60 }
76 -
77 - // Reset the options back to their original state
78 - $advanced_excerpt->load_options();
79 -}
80 -
81 -function the_advanced_excerpt_lang( $atts, $content = '' ) {
82 -
83 - $settings = shortcode_atts( array(
84 - 'lang' => 'en_us',
85 - ), $atts );
86 -
87 - $settings['lang'] = strtolower( $settings['lang'] );
88 - $locale = strtolower( get_locale() );
89 -
90 - if ( $locale == $settings['lang'] ) {
91 - return $content;
92 - }
93 -
94 - return;
95 -
96 -} add_shortcode( 'advanced_excerpt_text', 'the_advanced_excerpt_lang' );
61 +}