• Resolved tirux

    (@tirux)


    Hello,

    I am starting to like this plugin but I need to integrate the following inside a custom textfield form:

    [user-data field_name= ‘Username’ plain_text=’No’]

    The complete code is:

    <form method=”post” action=”www.example.com”>
    Usuario: <input name=”Usuario” type=”text” value=”[user-data field_name= ‘Username’ plain_text=’No’]” readonly=”readonly”>
    <input type=”submit” value=”Enviar Datos”>
    </form>

    The thing is, instead of the username it appears the whole shortcode. (it works fine outside the form)

    I need this in order to work with my personal MySQL database with your plugin.

    https://wordpress.org/plugins/front-end-only-users/

Viewing 1 replies (of 1 total)
  • Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Hi tirux,

    Where are you adding this form?

    To achieve what you’re after, you’d likely have to add this form directly into the appropriate theme template file (e.g. page.php), this because you need to use a combination of HTML and PHP. There, you could do something like:

    <?php $userData = do_shortcode('[user-data field_name="Username"]'); ?>
    
    <form method="post" action="www.example.com">
    Usuario: <input name="Usuario" type="text" value="<?php echo $userData; ?>" readonly="readonly">
    <input type="submit" value="Enviar Datos">
    </form>
Viewing 1 replies (of 1 total)
  • The topic ‘Is it possible to add username field inside a custom form?’ is closed to new replies.