Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Veda

    (@vedathemes)

    Replace the above code with the following (check htmlspecialchars added before sanitize_text_field),

    //PODCAST PLAYER ADD CUSTOM FIELD GET_THE_TITLE
    add_filter( 'podcast_player_shcode_display', function( $args ) {
        $id = get_the_ID();
    
        if ( ! $id || ( 'https://www.omnycontent.com/d/playlist/0009b167-0e82-414e-91eb-aae8011fc66d/9b29ae9e-7123-4139-bb90-ac6a00dba4fe/597c0df8-2974-4321-9480-ac6a00dbc975/podcast.rss' !== $args['url'] ) ) {
            return $args;
        }
        $filterby = get_the_title();
        $args['filterby'] = $filterby ? htmlspecialchars( sanitize_text_field( $filterby ) ) : $args['filterby'];
        return $args;
    } );
    
    

    Inform me for more help on this.

    Thanks,

    Thread Starter ofmarconi

    (@ofmarconi)

    Hi!

    Thanks, but for me it’s still the same, just this episode that doesn’t work.

    I copy the title and paste it in another widget (non-shortcode) that has the search box, the episode is found there: https://podcastdiscotecabasica.com/o-programa/?swcfpc=1#:~:text=Escute%20nossos%20%C3%BAltimos%20epis%C3%B3dios%3A

    screensave: https://i.postimg.cc/8cYtSdZn/image.png

    the widget that doesn’t work has this shortcode:

    [podcastplayer feed_url='https://www.omnycontent.com/d/playlist/0009b167-0e82-414e-91eb-aae8011fc66d/9b29ae9e-7123-4139-bb90-ac6a00dba4fe/597c0df8-2974-4321-9480-ac6a00dbc975/podcast.rss' number='10' cover_image_url='enter_custom_img_url' hide_cover='true' hide_description='true' hide_social='true' hide_subscribe='true' hide_search='true' hide_content='true' hide_loadmore='true' hide_download='true' accent_color=''][/podcastplayer]

    Thread Starter ofmarconi

    (@ofmarconi)

    I think it is related to the character “&” what do you think?

    I looked for other titles with “&” and I didn’t find it, that seems to be the only different characteristic from the other titles.

    Plugin Author Veda

    (@vedathemes)

    Hi @ofmarconi ,

    Yes earlier I also thought the same. However, the solution above was not working for you. I will have to re-test everything. I will update you soon.

    Thanks,

    Thread Starter ofmarconi

    (@ofmarconi)

    I appreciate every attempt at a solution!

    Thank you so much!

    Thread Starter ofmarconi

    (@ofmarconi)

    Hi!

    I don’t know if this helps but I found another episode where the plugin doesn’t find the player:

    https://podcastdiscotecabasica.com/t03e06-sobrevivendo-no-inferno-racionais-mcs-1997/
    T03E06: Surviving in Hell – Racionais MC’s (1997)
    https://i.postimg.cc/ZnNshRT2/image.png

    I thought maybe it was the character ” ‘ “, but I have another episode that has the same and it works: https://podcastdiscotecabasica.com/t01e16-phil-spectors-christmas-album-varios-artistas-1963/

    thx

    Plugin Author Veda

    (@vedathemes)

    Hi @ofmarconi ,

    Sorry for the delayed response. I will check and try to resolve the issue today. Will update you on that.

    Thanks,

    Thread Starter ofmarconi

    (@ofmarconi)

    Hi!

    An alternative that I found to solve punctually is using the two snippets:

    //PODCAST PLAYER ADD CUSTOM FIELD GET_THE_TITLE with "htmlspecialchars" for convert special to HTML
    add_filter( 'podcast_player_shcode_display', function( $args ) {
        $id = get_the_ID();
    
        if ( ! $id || ( 'https://www.omnycontent.com/d/playlist/0009b167-0e82-414e-91eb-aae8011fc66d/9b29ae9e-7123-4139-bb90-ac6a00dba4fe/597c0df8-2974-4321-9480-ac6a00dbc975/podcast.rss' !== $args['url'] ) ) {
            return $args;
        }
        $filterby = get_the_title();
        $args['filterby'] = $filterby ? htmlspecialchars( sanitize_text_field( $filterby ) ) : $args['filterby'];
        return $args;
    } );

    +

    //PODCAST PLAYER ADD CUSTOM FIELD GET_POST_META
    add_filter( 'podcast_player_shcode_display', function( $args ) {
        $id = get_the_ID();
    
        if ( ! $id || ( 'https://www.omnycontent.com/d/playlist/0009b167-0e82-414e-91eb-aae8011fc66d/4f6d62c7-be7a-4d80-bc62-ace2013528cb/81c945fb-1467-45ed-b193-ace2013528de/podcast.rss' !== $args['url'] ) ) {
            return $args;
        }
        $filterby = get_post_meta( $id, 'ep', true );
        $args['filterby'] = $filterby ? sanitize_text_field( $filterby ) : $args['filterby'];
        return $args;
    } );

    Then in the posts that I’m having this problem because of the “&” I manually add a snippet of the title for example = S01E02

    Thanks!

    • This reply was modified 2 years, 6 months ago by ofmarconi.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Podcast not found by post title (functions custom code)’ is closed to new replies.