• Hello.

    How can I remove the “” (speech marks) around the title of the audio file in a playlist.
    They are hard coded into the ‘media.php’ in ‘includes folder, which is obviously a core file (line 1847 on my install)
    Is there a way to over-ride this in a non destructive way?
    I read this >> https://core.trac.www.ads-software.com/ticket/33391 which suggests the same thing and is marked as ‘fixed’ but this was two years ago and is still hard coded.

    Any help gratefully received. Thanks in advance : )

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Is this a problem on the front-end of your website? If so, this may be a simple CSS fix you can carry out temporarily – Can you show us your website where the speech marks are?

    Thread Starter Morphim

    (@morphim)

    Hi Andrew. Thanks for the reply. I can’t show you the page as it’s a dev site but the code is this (lines 1838 – 1858 in wp-includes/media.php

    <script type="text/html" id="tmpl-wp-playlist-item">
    	<div class="wp-playlist-item">
    		<a class="wp-playlist-caption" href="{{ data.src }}">
    			{{ data.index ? ( data.index + '. ' ) : '' }}
    			<# if ( data.caption ) { #>
    				{{ data.caption }}
    			<# } else { #>
    				<span class="wp-playlist-item-title"><?php
    					/* translators: playlist item title */
    					printf( _x( '“%s”', 'playlist item title' ), '{{{ data.title }}}' );
    				?></span>
    				<# if ( data.artists && data.meta.artist ) { #>
    				<span class="wp-playlist-item-artist"> &mdash; {{ data.meta.artist }}</span>
    				<# } #>
    			<# } #>
    		</a>
    		<# if ( data.meta.length_formatted ) { #>
    		<div class="wp-playlist-item-length">{{ data.meta.length_formatted }}</div>
    		<# } #>
    	</div>
    </script>

    It’s obviously this part, which I’ve temporarily edited, knowing that an update will erase it back to default:
    printf( _x( '“%s”', 'playlist item title' ), '{{{ data.title }}}' );
    edited to this:
    printf( _x( '%s', 'playlist item title' ), '{{{ data.title }}}' );

    Once again, if there is a functions edit I can use to over-ride this or something else, I’d be grateful of any direction. Thanks

    Thread Starter Morphim

    (@morphim)

    Here is a generic image of a wp playlist. They are all the same and all feature the “” either side of the title, like “teenage dreams” on the first line

    https://cdn2.wpbeginner.com/wp-content/uploads/2015/05/audio-playlist-wp.png

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Unfortunately we need to see the CSS on a page somewhere to help – if it is indeed a CSS problem.

    Can you emulate your webpage using a tool like CSSDesk.com?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    1. View your webpage;
    2. Right click on the page somewhere and press “View source
    3. A new window will appear with all the code of your page. Copy all of that code
    4. Go to CSSDesk.com and paste it into the “HTML” section
    5. Press the “Share” button in CSSDesk
    6. A new URL will appear to the left of the “Share” button, copy that URL and paste it here in this thread

    We can then hopefully see your webpage without it going live.

    Thread Starter Morphim

    (@morphim)

    The easiest thing was to create a quick playlist on a live install of WP I have. As mentioned, this is the same for all playlist on everyone’s WP install using the built in [audio]. The “” seems to be the only thing I can’t easily remove with CSS. Pretty much everything else is selectable. The only thing i think I can do with CSS to remove the “” is hide the whole title, which I don’t want to do.

    Here is the link:
    https://www.hughjan.us/audio-example/

    Thanks again for your help

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I see. The Core ticket suggested it was a CSS problem but it isn’t. Sorry I can’t help more.

    Thread Starter Morphim

    (@morphim)

    Yes, as mentioned in my initial post, it’s hard coded. The core thread I linked to is based on this hard coding and suggests moving it to css but, as also mentioned above ‘is marked as ‘fixed’ but this was two years ago and is still hard coded.’

    Thread Starter Morphim

    (@morphim)

    If anyone is interested, I solved this by adding a custom template script of the playlist code, via a plugin, with modifications to remove the quotes / speech marks around the playlist item title.

    This solution was actually used to be able to add a download link to the audio within a playlist but made it possible to safely remove the “” too.

    The method / script I used is here >>
    https://wordpress.stackexchange.com/questions/292585/adding-a-download-link-to-native-wordpress-playlist/

    I hope this might help someone else : )

    • This reply was modified 6 years, 8 months ago by Morphim.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WP Audio Player – remove ” ” speech marks around title’ is closed to new replies.