make user_id in a shortcode dynamic based on who’s logged in
One option is to register your own shortcode to act as a wrapper for the plugin’s shortcode. In the wrapper callback you would then retrieve the current user’s ID and pass it to the actual shortcode. Simplified example, add_shortcode( ‘my_user_profile_avatar’, ‘my_user_profile_avatar_callback’ ); function my_user_profile_avatar_callback( $atts, $content = null ) { // (int) The current user’s … Read more