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

    (@xnau)

    Textarea fields don’t normally add line breaks or paragraph tags. You don’t say where you see these things, probably those tags aren’t stored in the database. Usually it’s the theme that is adding them to the content when the field is displayed.

    Thread Starter pulidomate

    (@pulidomate)

    I just saw now that’s the problem is Insert PHP plugin, maybe doesn’t escape correctly the tags.

    My code is:

    [insert_php]
    global $current_user;
    if(Participants_Db::get_record_id_by_term(‘user_login’, $current_user->user_login, true)){
    echo do_shortcode(‘[pdb_record record_id=”‘ . Participants_Db::get_record_id_by_term(‘user_login’, $current_user->user_login, true) . ‘”]’);
    }else{
    echo'[pdb_signup]’;
    }
    [/insert_php]

    Do yo see any error?

    Plugin Author xnau webdesign

    (@xnau)

    No, there is no error there. The issue happens when the content of the page is displayed, and the theme (or plugin) adds automatic formatting.

    Thread Starter pulidomate

    (@pulidomate)

    The problem is in the do_shortcode.

    Paragraph and line break tags appear with:

    echo do_shortcode(‘[pdb_record template=bootstrap record_id=”‘ . Participants_Db::get_record_id_by_term(‘user_login’, $current_user->user_login, true) . ‘”]’);

    using the same code of: https://xnau.com/using-participants-database-with-wordpress-users/

    But it’s ok with:

    echo ‘[pdb_record record_id=”17″]’;

    Obviously, i want to have user id.

    It doesn’t matter the template and other plugins.

    Plugin Author xnau webdesign

    (@xnau)

    If you can use echo '[pdb_record record_id="17"]'; and get content from the plugin, then the PHP plugin must be processing it’s output through the “do_shortcode” filter. It probably shouldn’t do that, it will give you the kinds of problems you’re seeing.

    However, since it’s doing that, have you tried something like:

    echo '[pdb_record record_id=' . Participants_Db::get_record_id_by_term('user_login', $current_user->user_login, true) . ' ]';

    Thread Starter pulidomate

    (@pulidomate)

    It works!!!!!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem with textarea and tags’ is closed to new replies.