• Resolved kschlager

    (@kschlager)


    On custom post type archive pages we need to manually set the title and the URL to share, otherwise the plugin will use title and URL of the first post and not the archive page itself.
    We do this by setting the parameters url and title.
    [shariff url=”https://xxxx” title=”custom title”]

    The URL is working fine but the title does not. There are two small defects in shariff.php that we had to fix, please be so kind and include that in the project:

    shariff.php line 575:
    – if ( array_key_exists( ‘title’, $atts ) ) $share_title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, ‘UTF-8’ ) );
    + if ( array_key_exists( ‘title’, $atts ) ) $share_title = urlencode( $atts[‘title’] );

    shariff.php line 1123:
    – $subject = html_entity_decode( get_the_title(), ENT_COMPAT, ‘UTF-8’ );
    + $subject = $share_title;

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jan-Peter

    (@starguide)

    Hi kschlager,

    thank you for the hint. The first one is definitely and quite obviously just a copy&paste bug. I’ll fix it in the next release.

    The second one on the other hand does not make much sense to me right now. The $share_title variable is not defined in the mail form function. I can’t see how that could work. On the other hand the mail form is also only available on single posts / pages. On blog overview and other non singular pages it should be automatically replaced with mailto.

    Cheers,
    JP

    Thread Starter kschlager

    (@kschlager)

    You’re right, the second fix is nonsense. I just searched for get_the_title() and came along this line. Didn’t even recognize it was in another function.

    Thank you.

    Plugin Author Jan-Peter

    (@starguide)

    Fixed in version 4.3.0. Please update and test, if it is now working as intended for you.

    Cheers,
    JP

    Thread Starter kschlager

    (@kschlager)

    Great, works as expected.
    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Manually setting share title not working’ is closed to new replies.