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

  1. pstiel
    Posted 3 years 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?


  2. WillBontrager
    Plugin Author

    Posted 3 years 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.


  3. pstiel
    Posted 3 years ago #

    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.

  4. WillBontrager
    Plugin Author

    Posted 3 years 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.


  5. pstiel
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Insert PHP
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic