• Thanks for an awesome plugin, really helped me get my one-page type of site going.

    Would it be possible to add more user fields in the next release, such as description (bio) and website?

    Also, a nice feature would be to add custom user fields, such as a Facebook Profile URL field that can be called by [user facebook] or [user field=’facebook’].

    Cheers!

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

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

    (@miyarakira)

    Thank you for the suggestion. That sounds useful – I’ll see about adding parameters for displaying more user fields.

    As for adding custom user fields, I’ll look into how it could be implemented. Probably there are plugins that do this already, in which case I’ll focus on how to display the created user fields.

    Anyway, I’ll let you know when I find out more.

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    As suggested, I added a parameter to display user meta.

    [user meta="description"]

    However, the plugin doesn’t handle adding new user profile fields. For that you can use another plugin (try a search for “user field”, “profile field”, etc.) or you can custom-build it.

    Here’s a snippet I found, which you can place in the theme’s functions.php:

    add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
    add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
    
    function my_show_extra_profile_fields( $user ) { ?>
    
        <h3>Extra profile information</h3>
    
        <table class="form-table">
            <tr>
                <th><label for="twitter">Twitter</label></th>
                <td>
                    <input type="text" name="twitter" id="twitter" value="<?php echo esc_attr( get_the_author_meta( 'twitter', $user->ID ) ); ?>" class="regular-text" /><br />
                    <span class="description">Please enter your Twitter username.</span>
                </td>
            </tr>
        </table>
    <?php }
    
    add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
    add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
    
    function my_save_extra_profile_fields( $user_id ) {
    
        if ( !current_user_can( 'edit_user', $user_id ) )
            return false;
    
        /* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */
        update_usermeta( $user_id, 'twitter', $_POST['twitter'] );
    }
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘More user fields’ is closed to new replies.