WordPress.org

Ready to get started?Download WordPress

Forums

Insert PHP
[resolved] Conflict with twitter-tweets in posts (5 posts)

  1. pstiel
    Member
    Posted 1 year ago #

    Since version 3.4, WordPress displays tweets within posts by just inserting the tweet's URL within the text of the post.
    (see for example http://www.achteminute.de/20121229/wudc-2013-day-1-twitter-review/)

    I discovered today that the Insert PHP Plugin breaks this functionality. If I activate the plugin, instead of the tweets, you will only see the URL.

    Can you help with this conflict?
    Thanx
    Philipp

    http://wordpress.org/extend/plugins/insert-php/

  2. WillBontrager
    Member
    Plugin Author

    Posted 1 year ago #

    Perhaps. At least I can have a look.

    Post the PHP code you're running with Insert PHP and also a tweet URL that breaks.

    I'll see what I can see.

    Will

  3. pstiel
    Member
    Posted 1 year ago #

    Hey,
    well, the problem appears with normal twitter-URLs inserted into posts (like this one: https://twitter.com/m_carcasona/status/338986300663283712) which normally should transform into a nicely formatted tweet-box. The problem appears as soon as I activate this extension, even without actually using it on a page.
    Best
    Philipp

  4. WillBontrager
    Member
    Plugin Author

    Posted 1 year ago #

    OK, looks like WordPress discards everything from the twitter page source code except the tweet and related info it publishes, provided the twitter URL is on a line by itself. As you noted, somewhere in the process, Insert PHP interferes.

    This is a temporary fix:

    At line 58 of the plugin's insert_php.php file you'll see

    add_filter( 'the_content', 'will_bontrager_insert_php', 9 );

    change that to

    add_filter( 'the_content', 'will_bontrager_insert_php', 7 );

    (The only change is the digit 9 to 7).

    Verify the Insert PHP isn't now interfering with any of your other plugins.

    The digit can be brought still lower if needed for your current or future WP versions. But no lower than necessary to let it process the tweet page URLs. The digit is a priority number and the plugin shouldn't usurp any priority it doesn't actually need.

    Will

  5. pstiel
    Member
    Posted 1 year ago #

    Thank you for this quick fix, it's working.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags