Publish posts only after the condition is met

Setup cron job You want to do some action (i.e. publishing a post) periodically, so first you need to schedule a cron job. Cron jobs are actions, that are fired periodically at some sort of a time interval. You can either use (non-perfect) WordPress Cron or replace it with a real cron job on your … Read more

Publish Post After Click On A Link

When the post is created and set to pending, build a unique identifier for auto-publishing, for example: $unique = md5( $post->post_content ); add_post_meta( $post->ID, ‘_auto_publish’, $unique ); Now create a link for the email: $link = get_permalink( $post->ID ); $link = add_query_arg( array( ‘autopublish’ => $unique, ‘pid’ => $post->ID ), $link ); Send this link … Read more

Prevent publish status/date saved on transition_post_status hook

I think that hook fires after the post status has been updated. Try this add_action( ‘pre_post_update’, ‘intercept_adherence_publishing’, 10, 2); function intercept_adherence_publishing ($post_ID, $data ) { if (get_post_type($post_ID) !== ‘protocol-adherence’) { return; } $post = get_post($post_ID); $adherence_status = $_POST[‘_adherence_status’]; if ( ( $data[‘post_status’] === ‘publish’ ) && ( $post->post_type == ‘protocol-adherence’ ) && ( $adherence_status !== … Read more

How to display and use all existing tags at my write-post-at-frontend-panel?

try something like this: <?php $taxonomies = array( ‘wissen_tags’ ); $args = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => false ); $terms = get_terms($taxonomies,$args); if (count($terms) > 0): i = 0; foreach ($terms as $term): ?> <div class=”wissen_tag_list”> <input type=”radio” value=”<?php echo $term->term_id; ?>” name=”wissen_tags” class=”wissen_tag_list_ckb” <?php if ( $i == 0 ) … Read more