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

Show Featured Image Dimensions and size frontend with shortcode

Yes, that is possible. Building upon the answer Nicolai Grossherr gave to Get the size (size in Kb or MB) of an featured image? you could do something like this, // e.g. in functions.php add_shortcode( ‘my_image_metadata’, ‘my_image_metadata_callback’ ); function my_image_metadata_callback($atts) { $img_meta = wp_get_attachment_metadata( get_post_thumbnail_id() ); if ( ! $img_meta ) { return; } $upload_dir … Read more