WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Excerpt
V 4.1.1 inserting p and br tags which are breaking my media players (6 posts)

  1. phpadam
    Member
    Posted 2 years ago #

    3.1 works fine and I was using it for weeks without a problem. I am using MediaElement.js to play audio files. A shortcode is used to display the player and I want the player to be in the excerpt.

    When I upgraded to 4.1.1, it is now adding br and p tags WITHIN other player tags and I think this is what is breaking the player.

    Here is the html code in the excerpt that is created to generate the player as it is displayed when using the Advanced Excerpt plugin version 3.1

    <div id="post_audioplayer">LISTEN TO THE SHOW:<br />
    <audio id="wp_mep_1" src="http://mp3filepath.com/hrn/audios/1834/xxxxxx.mp3"     controls="controls" preload="none"  >
    
    <object width="600" height="30" type="application/x-shockwave-flash" data="http://xxx.com/site/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf">
    <param name="movie" value="http://xxx.com/site/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf" />
    
    <param name="flashvars" value="controls=true&file=http://mp3filepath.com/hrn/audios/1834/xxxxx.mp3" />
    </object>
    </audio>
    </div>

    And here is the code in the excerpt when using v. 4.1.1

    <div id="post_audioplayer">LISTEN TO THE SHOW:<br />
    	<audio id="wp_mep_1" src="http://mp3filepath.com/hrn/audios/1834/xxxxx.mp3"     controls="controls" preload="none"  ></p>
    <p>		<object width="600" height="30" type="application/x-shockwave-flash" data="http://xxx.com/site/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf"><param name="movie" value="http://xxx.com/site/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf" /><param name="flashvars" value="controls=true&file=http://mp3filepath.com/hrn/audios/1834/xxxxx.mp3" /></object><br />
    	</audio><br />
    </div>

    you can see that they are identical, except that now there are br and p tags being added BETWEEN the opening and closing audio tags.

    And this is breaking the players.

    Anyone know how I can fix this?

    http://wordpress.org/extend/plugins/advanced-excerpt/

  2. phpadam
    Member
    Posted 2 years ago #

    It also seems that the control over adding and removing tags using the check boxes in the admin section is broken now. I can't seem to uncheck br and/or p without removing any of the tags I've added using the more tags dropdown. Changes are not being saved consistently and added tags are vanishing. Very odd.

  3. Samara
    Member
    Posted 2 years ago #

    Same issue here. I updated and the plugin no longer ignores the br tag. Seems that none of the functions actually work in the backend or with php overrides.

  4. basvd
    Member
    Posted 2 years ago #

    I am aware of this issue and it will be resolved in the next update.

    The problem is likely due to some default filters, so I have this simple hack you can try (effects are temporary, but use your own judgement).
    Add the following to your theme's functions.php (create the file if it does not exist):

    <?php
    remove_all_filters('the_excerpt');

    I will check the settings handling soon for the problem you described.

  5. theonetruebix
    Member
    Posted 1 year ago #

    Ah, that solved my problem as posted earlier today in a new thread, although it then meant having to go into theme template files and wrap the_excerpt in p tags.

  6. JCIstevens
    Member
    Posted 1 year ago #

    Yes, that fixed for me too. Thanks for the tip. Works great now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic