Automatically changing a posts status to draft based on magic fields [closed]

For cron jobs, take a look at the Transients API. The rest could maybe be acchieved with something like the following. I have never ever used the transient API before and code’s not tested. function set_post_to_draft() { global $post; if ( get_post_meta( $post->ID, ‘set_to_draft_key’ ) == true ); return $post->post_status == ‘draft’; } set_transient( ‘post_to_draft_transient’, … Read more

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