Include scheduled ( future ) posts in WordPress post navigation ( previous_post_link, next_post_link )

You can do this by using the get_{$adjacent}_post_where filter. Basically all we are doing is replacing the part of the query that says “find published posts” with “find published or future posts”. /** * Amend the ‘WHERE’ clause in the SQL query to find an adjacent post * * @param required string $where The default … Read more

Comments on future posts

You can not enable comments in future posts. Those posts are not public and are not private, so they verify the conditional in line 61 of wp-comments-post.php file; that conditional is (WP 4.1.1): } elseif ( ! $status_obj->public && ! $status_obj->private ) { /** * Fires when a comment is attempted on a post in … Read more

How to export custom post type with ACF to individual file with automation?

Schedule your backup with WP Cron – https://codex.wordpress.org/Function_Reference/wp_schedule_event In the cron event, run your query for posts or CPTs and be sure to add ‘numberposts’ => -1, to return all. When you loop through your posts from the resulting query, push the values to an array $data[]=$some_string_data_for_prop; https://www.advancedcustomfields.com/resources/get_field/ https://developer.wordpress.org/reference/functions/get_post_meta/ https://codex.wordpress.org/Class_Reference/WP_Post And when you’re ready to … Read more

Is there a way to schedule changes to a page?

you can do this with a shortcode like this add_shortcode(“custom_text_se282078”, function ($attr, $content, $tag) { $result = “”; if (date_i18n(“H”) > $attr[“time”]) { $result = $attr[“text_after”]; } else { $result = $attr[“text_before”]; } return $result; }); with that you just have to put that in the page : [custom_text_se282078 time=”10″ text_before=”text before 10 h” text_after=”texte … Read more

Add scheduled page or post in the menu section on back-end

You can add the future pages with the filter nav_menu_items_page Notes: You can do the same with the posts or other cpt by changing the post type in the hook nav_menu_items_{$post_type} This filter is for the View All tab in the pages. Example: function add_scheduled_pages($posts, $args, $post_type) { $query = new WP_Query( array( ‘post_type’ => … Read more

Include future posts in tags and in search

To achieve the intended result you will have to modify the query by adding the future value to the post_status parameter via the pre_get_posts filter hook. add_action( ‘pre_get_posts’, ‘se338152_future_post_tag_and_search’ ); function se338152_future_post_tag_and_search( $query ) { // apply changes only for search and tag archive if ( ! ( $query->is_main_query() && (is_tag() || is_search()) ) ) … Read more