Using the_field();
will just return the content of that field (guessing it’s just text field?).
<?php
if (is_user_logged_in()) {
$userid = get_current_user_id();
get_userdata($userid);
$shortcode = get_field('view_files_shortcode', 'user_' . $userid);
}
?>
<?php echo do_shortcode($shortcode); ?>
Related Posts:
- Including Custom fields within the_content
- Can ‘Custom Field’ data be inserted into this Short Code?
- Updating Metadata with Shortcode
- Block error message in foreach loop when looping through ACF field
- Custom fields changes the formatting of metabox input
- How can I put a custom field as the link of a button shortcode?
- Shortcode Displays 2 times
- Get value from shortcode to do something
- wordpress allow user to edit user profile with custom fields
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Need Help Fixing My Iframes [closed]
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Firing schema via code in functions.php doesn’t work
- Colon is Missing In My Website Url in WordPress
- Adding number to date not working [closed]
- How can I add extra word in permalink when someone click download button?
- Saving and Restoring a Canvas on A Individual User Basis
- Custom shortcode outputs plain text instead of HTML at top of post
- Seach custom post type posts only by meta fields?
- How to use wp_add_inline_style for custom CSS added via shortcode?
- How to use thumbnail size of image if I’m only using src to get image
- Pass php dynamic variable to shortcode
- How can I dynamically update the class in my shortcode?
- Creating own shortcode – echoeing php variable based on JS variable
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- how to retrieve a value if a checkbox is checked
- Trouble checking if custom woocommerce checkout field is empty or not
- Two queries for a WP_User_Query search work perfectly apart, but not together
- How create a Shortcode with hover and complex options
- Remove from shortcode
- Displaying recent posts on static page with template-part via shortcode
- auto-populating custom nav with all items from custom post type
- wordpress 4.4 self hosted video (html5) doesn’t show
- do_shortcode with custom field
- Add / Update Custom Fields After Select Pictures in Media Window
- How to Reference/Echo Variable from Another PHP Function
- Remove echo from shortcode
- Replace shortcode in substring
- conditional logic for front-end custom field edits
- Trying to retrieve post meta
- Automatic Shortcode Creation with Custom Fields [closed]
- Custom field values to taxonomy terms
- How would an if statement surrounding a custom field with two variables (holding values) look like?
- Shortcode to show the code
- Shortcode returns values in the wrong order
- Redirect to another page using contact form 7? [closed]
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- Get URL from shortcode tag
- Embedding PHP in shortcode $content
- Custom Field IF/ELSE PHP
- Shortcode with PHP issue “Undefined index”
- Which PHP page is the Default Posts Page
- How to combine 2 php functions into one function with a custom field
- Remove the last X characters of a custom field value
- Excecuting php function in shortcode
- Advanced Custom Fields – display label and value only if value entered
- Only first shortcode gets executed
- Is it possible to retrieve all posts with a certain value for metadata?
- Multiple do_shortcode in page template
- Saving zero in meta box
- Non-Closing PHP Query in WordPress Loop
- Returning data instead of echoing/printing
- echo something inside a shortcode
- displaying content that includes shortcodes within an echo
- List taxonomy term slugs within shortcode (do_shortcode)
- Find a way to retrive data updated through metabox plugin to web page
- Shortcode from a function not working
- Display Data in Table from External Database in WP using Shortcodes
- get_posts works in the page template but not in a shortcode
- Is it possible to return content, and then also continue to do other things?
- Why are the details of my todo not saving?
- ::before on open/close function [closed]
- anyway to put inside a $outprint=sprintf()
- How to check if a PHP string is different than meta field?
- Can’t save php string to a custom field
- Display custom field on 404 page outside loop
- Is There A Way To Make Theme Files Accept Shortcodes?
- Why does this update_post_meta function not delete the custom field itself?
- How to show/hide php table rows based on the content of custom fields
- How can I include shortcodes within PHP?
- Run str_replace on title and save the output to a custom field
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Create a WordPress shortcode using PHP [duplicate]
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- $wpdb returns duplicate posts
- Creating WordPress Shortcode with Variable
- Catchable fatal error: Object of class stdClass could not be converted to string
- Syntax error in a shortcode function
- Using Shortcode to Grab Archive Listing, Separate by Year
- Capitalize Shortcode Value on Output
- Shortcode to find and replace URL
- Why is my str_replace not working on short code submitted by front-end?
- Could use some help with Shortcodes
- How to put a form with php code into a variable or shortcode?