Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter rberg

    (@rberg)

    Some more data, after looking at the Simple Share Buttons file…

    It looks like the Simple Share Buttons code

    get_the_title($post->ID);

    used to return something like this:

    “Event Title”

    After the recent update, that same code returns this:

    <span class=" summary">Event Title</span>

    Again, we didn’t have that issue until the most recent All-in-One Calendar update. It’s not a problem on the page with the calendar itself, just the individual event detail pages.

    Thanks,
    Rick

    EDIT: Not optimal, but just in case someone else encounters this. I added the code

    if (strpos($strPageTitle,'</span>') !== false) {
       				$strPageTitle = ltrim($strPageTitle,'<span class=" summary">');
    				$strPageTitle = rtrim($strPageTitle,'</span>');
    			}

    to the Simple Share Buttons plugin to check for this issue, and remove it if necessary.

    BTW: get_the_title() and the_title() can return HTML. If your plugin expects no HTML in the title of a post/page, it needs to be updated to fix it, so what you’ve done is pretty much the right way to go about it.

    Note that if something was using the_title() they could use function the_title_attribute() instead.

    To be specific, the WP-Typography plugin also puts HTML in titles, so the same bugs that you’re seeing with the sharing plugin are going to happen if you were using the WP-Typography plugin instead.

    HI @rberg and @cefiar

    Would either of you mind pointing out where you added the code snippet to the Simple Share file? I’ve run into this problem, and I’ve tried inserting it in the email button section and elsewhere but I can’t seem to get it working. Any help is much appreciated!

    Thank you both.

    EDIT: nevermind – I found the more recent thread with the updated code fix – https://www.ads-software.com/support/topic/not-working-properly-on-events-page?replies=10

    Thank you!!

    Thread Starter rberg

    (@rberg)

    Hi panmac. The best solution I’ve seen (better than mine above) is near the bottom of this page by user nppbc:

    https://www.ads-software.com/support/topic/not-working-properly-on-events-page?replies=10

    The code he/she has posted there goes in your theme’s functions.php file. I put it right at the top of that file, after the <?php.

    edit: I see you found it ?? Good luck.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue with calendar and Simple Share Buttons’ is closed to new replies.