Support » Plugin: Global Content Blocks » PHP blocks fail since intro of visual editor

  • Resolved wp.Man


    UPDATE: this is due to addon “TinyMCE Advanced” if option to stop removing <p> and </ br> tags is enabled. hopefully a fix can be implemented in GCB? personally, if adding a PHP tag, i’d rather use a plain text editor with fixed width font

    since the introduction of the visual (WP) editor, PHP blocks such as…

    $str = file_get_contents('');
    echo $str;

    fail with…

    Parse error: syntax error, unexpected '<' in /home/siteorg/public_html/wp-content/plugins/global-content-blocks/global-content-blocks.php(211) : eval()'d code on line 1

    existing blocks work fine as long as they are not edited/saved


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author benz1


    Are you entering the PHP in HTML mode and not via the visual editor?

    I tried your code on a block and nothing appeared on the page, not even the parse error but I tried a
    echo 'your ip is '.$_SERVER['REMOTE_ADDR'];
    and it worked perfectly.

    I could look at diaabling the visual editor if PHP Code is selected as the type.

    hi benz
    i tried in both in the visual and html editors, but as i mentioned this is due to the TinyMCE Advanced plugin

    i’ve switched to Ultimate TinyMCE and there’s no problem

    if others complain then it might be something to take a closer look at, but i’m fine

    i would suggest possibly using a plain text editor for PHP code though


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP blocks fail since intro of visual editor’ is closed to new replies.