How to execute a shortcode within a custom field?

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); ?>

Set post status to draft after validating post meta values in save_post hook

After some research, I altered my approach to validate the meta values in the following way: Create a new meta key(for post type) to store the validation (0 and 1). Initiate it with 0. This need not be kept/shown in the meta form. While saving the meta fields (preferably within save_post hook), set its value … Read more

Modal pop-up HTML code works on other sites or HTML viewers but not in the custom HTML block within a wordpress page?

There are a couple of issues with what you are trying to do. See this for reference: WordPress support for Custom HTML blocks First, you cannot reliably add JS code directly into any block, which is intended only for HTML and text. While the script tags may technically be HTML, your JS code certainly is … Read more