I am using a plugin that generates a shortcode to display files from a Dropbox folder. I need to display the shortcode on a specific page, but it will be different for each user.
Therefore I have created a custom field for each user, called 'view_files_shortcode'.
I thought I could then call this user custom field on the page, and it would display whatever was set for each user. However it just displays the actual shortcode.
Currently I am using this:
<?php if ( is_user_logged_in() ) {
$userid = get_current_user_id();
get_userdata( $userid );
get_field('view_files_shortcode', 'user_'. $userid );}?>
<?php the_field('view_files_shortcode', 'user_'. $userid ); ?>
Can anyone tell me how to make the shortcode execute? Thank you.
do_shortcode()
- see the documentation for examples.