I'm trying to create a WP shortcode that will insert a profile form for a Wordpress user.
I want to call the following action:
<?php do_action( 'bbpnns_digest_show_profile_form', $user); ?>
Where $user
is the WP_User object for the user being displayed.
Here's what I have so far but it doesn't work (I get a "Bad User" message):
function custom_shortcode_sc() {
$current_user = wp_get_current_user ();
$user=$current_user->user_login;
do_action( 'bbpnns_digest_show_profile_form', $user);
}
add_shortcode( 'custom_shortcode', 'custom_shortcode_sc' );
I think I am close but am missing something with calling the $user properly. Thanks for your help!