• Resolved dpurselle

    (@dpurselle)


    I am trying to integrate WordPress users with Participants Database as described on your website: http://xnau.com/using-participants-database-with-wordpress-users/

    When I insert the shortcode into the page using a PHP plugin, I am getting a Parse error:

    Code on page:

    [insert_php]
    echo do_shortcode(‘[pdb_list filter=”user_login=’ . $current_user->user_login . ‘”]’);
    [/insert_php]

    Page output:

    Parse error: syntax error, unexpected T_VARIABLE in /home/content/01/12721101/html/CAG/wp-content/plugins/insert-php/insert_php.php(48) : eval()’d code on line 2

    This occurs with both [pdb_list] and [pdb_record] in several different themes and with multiple php plugins. The code works fine if I put it directly into the page template file (although sometimes the formatting is a bit screwy). I am experimenting with various themes and would prefer not to rebuild the page template files each time I change themes.

    https://wordpress.org/plugins/participants-database/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Well the code looks good. You may need to declare that global variable before you use it:

    global $current_user;

    But that’s just a guess.

    Thread Starter dpurselle

    (@dpurselle)

    That does not change the result.

    Plugin Author xnau webdesign

    (@xnau)

    Have you tried asking in the support forum for the php shortcode? This is not an error generated by the Participants Database plugin.

    Thread Starter dpurselle

    (@dpurselle)

    Problem is fixed. There must have been some random characters in the code. When I retyped everything from scratch using a text editor, it worked.

    Plugin Author xnau webdesign

    (@xnau)

    Ah, yes, I should have thought of that…it’s best to do these things in text mode, not visual mode.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Problem insert_php and shortcode’ is closed to new replies.