• Resolved piccart

    (@piccart)


    hello!

    the author link is built to point to the orign website url, and I imagine the reason is that not everyone has the same url structure for author pages (some doesn’t support them at all).

    though I was wondering if you can quickly add a simple filter which would allow us to change it?

    something like:

    if ( $authorName ) {
    	$domain      = parse_url( $newLink );
    	$authorURL = 'https://' . $domain['host'];
    	$authorURL = apply_filters( 'feedzy_author_url', $authorURL, $feedURL );
    	$contentMeta .= __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $authorURL . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $authorName . '</a> ';
    }

    thanks in advance!

    • This topic was modified 7 years, 6 months ago by piccart.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Themeisle

    (@themeisle)

    Sure thing, @piccart. We will add in the next release.

    Plugin Author Themeisle

    (@themeisle)

    @piccart, just went live now.

    Thread Starter piccart

    (@piccart)

    awesome! thanks!

    Thread Starter piccart

    (@piccart)

    hello!
    sorry but I’ve just noticed that there is a glitch in the new code about this..

    you are including the http when you set the authorURL var, but then you are also prepending it in the html string.

    $authorURL   = 'https://' . $domain['host'];
    $authorURL   = apply_filters( 'feedzy_author_url', $authorURL, $feedURL );
    $contentMeta .= __( 'by', 'feedzy-rss-feeds' ) . ' <a href="https://' . $authorURL . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $authorName . '</a> ';

    I can easily fix that using the filter for now, because I will filter it anyways, but you’d want to fix that. ??
    also, I would suggest to use // instead of specifying the http protocol. SSL is taking over nowadays. ??

    Thread Starter piccart

    (@piccart)

    sorry, one last thing!

    I’ve realized that we need the filter to pass the $authorName too, otherwise we cannot build the author’s url..

    thanks for your help and effort!

    Thread Starter piccart

    (@piccart)

    I’ve tested this in my site and is working just fine:

    if ( $authorName ) {
    	$domain      = parse_url( $newLink );
    	$authorURL   = '//' . $domain['host'];
    	$authorURL   = apply_filters( 'feedzy_author_url', $authorURL, $authorName, $feedURL );
    	$contentMeta .= __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $authorURL . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $authorName . '</a> ';
    }

    and if someone is interested on doing the same thing I need, then this is how it’ll be possible to build the author link following the most common permalink pattern:

    add_filter( 'feedzy_author_url', 'bwd_custom_feedzy_author_url', 10, 3 );
    function bwd_custom_feedzy_author_url( $authorURL, $authorName, $feedURL ){
        $url = $authorURL . '/author/' . sanitize_title($authorName) ;
    
        return $url;
    }
    Thread Starter piccart

    (@piccart)

    Sorry but I’ve noticed you deployed a new version yesterday and as you didn’t reply yet, I think you might have miss the last comments here because this ticket was marked as solved..

    the new var for the filter is just something needed for my personal purposes, but the duplicated http is breaking the author’s link and I think you would want to fix that. ??

    Plugin Contributor Hardeep Asrani

    (@hardeepasrani)

    Hey there,

    Thank you for reporting it to us. We’ll fix this. ??

    Plugin Author Themeisle

    (@themeisle)

    Hey @piccart,

    The latest version should have this fixed.

    Let me know how is working for you.

    Thanks !

    Thread Starter piccart

    (@piccart)

    hello!
    Not sure if it’s just me, but I cannot see any new version of the plugin.. the last version is 3.1.1 and released a couple of days ago which contains the $authorURL bug that I mentioned in the last couple of messages here (and in another specific ticket), and the $authorURL filter hook is missing the $authorName which is actually needed for building the custom links….

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘could you add a filter to edit the author link html?’ is closed to new replies.