Plugin Directory

Changeset 2373124


Ignore:
Timestamp:
09/01/2020 01:34:02 PM (6 years ago)
Author:
edge226
Message:

fix multi widget bug in title

Location:
audiate-me/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • audiate-me/trunk/audiate.php

    r2364787 r2373124  
    88 * Plugin URI: https://www.audiate.me
    99 * Description: Transform your content into audio to reach a larger audience with our Text-to-Speech widget.
    10  * Version: 1.2.2
     10 * Version: 1.2.3
    1111 * Author: Audiate.Me
    1212 * License: GPLv2 or later
  • audiate-me/trunk/includes/audiate-widget.php

    r2364787 r2373124  
    103103                add_filter('the_content', function( $content )  {
    104104                    return $this->add_code_to_post_content( $content, false );
    105                 }, 0, 2 );
     105                }, 14264, 2 );
    106106            }
    107107            else if ($this->options['position_4'] === 'after_title') {
    108108                add_filter('the_title', function( $content )  {
    109109                    return $this->add_code_to_post_content( $content, true );
    110                 }, 0, 2 );
     110                }, 14264, 2 );
    111111            }
    112 
    113112
    114113            add_shortcode('audiate-widget', 'getShortCode');
     
    128127    */
    129128    public function add_code_to_post_content($content, $isAfterContent) {
    130         global $post;
     129        global $post, $wp_filter;
    131130        $allowedPostTypes = array('post', 'page');
    132131
    133132        if (is_singular($allowedPostTypes) && is_single() && in_the_loop() && is_main_query()) {
     133
     134            if(isset($wp_filter[ 'the_title' ]) && isset($wp_filter[ 'the_title' ]->callbacks[ 14264 ])) {
     135                unset($wp_filter['the_title']->callbacks[14264]);
     136            }
    134137
    135138            $widget = $this->get_code();
     
    138141                    get_post_type() === 'post' && $this->options['show_on_all_posts_1'] === 'yes' ||
    139142                    get_post_type() === 'page' && $this->options['show_on_all_pages_3'] === 'yes'
    140 
    141143            ) {
    142144                    return AudiateWidget::stitchWidget($content , $widget, $isAfterContent);
    143145            }
    144 
    145 
    146146
    147147            $showOnPost = get_post_meta($post->ID, self::$fieldKey, true);
  • audiate-me/trunk/readme.txt

    r2364787 r2373124  
    66License URI: http://www.gnu.org/licenses/gpl-2.0.html
    77Tested up to: 5.4
    8 Stable tag: 1.2.2
     8Stable tag: 1.2.3
    99
    1010Elevate Your Content with Audio. Transform your content into audio to reach a larger audience with our Text-to-Speech widget.
Note: See TracChangeset for help on using the changeset viewer.