First you can to create a schedule for one minute, then bind function with that hook.
function add_new_intervals($schedules)
{
// add weekly and monthly intervals
$schedules['every_single_minutes'] = array(
'interval' => 60,
'display' => __('Every Minute')
);
return $schedules;
}
add_filter( 'cron_schedules', 'add_new_intervals');
// To schedule event for this minute event
wp_schedule_event( current_time( 'timestamp' ), 'every_single_minutes', 'my_every_minute_event');
//add_action('my_every_minute_event', '_Func_to_execute_');
check this quick reference for details
Thanks
Related Posts:
- WP Cron and wp_insert_post
- WP_QUERY returns empty set when fired from a WP-CRON scheduled event
- Show custom content when loop or wp query reaches specific time?
- cron job for custom post type not working since WordPress 5
- Updating an intensive wp_query result once daily
- WordPress: Cron locking and Queue
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- Way to include posts both with & without certain meta_key in args for wp_query?
- How to trigger 404 for custom query var?
- How can I use WP-CLI commands without –allow-root
- Calling a wp_query $posts causes a 500 error
- WP_query taxonomy + get all posts with two terms from same taxonomy
- How do I create my own nested meta_query using posts_where / posts_join?
- meta_query not working properly
- Best Practice For Querying Grandchildren?
- Using tax_query reverses my post_type argument in a custom WP_Query
- creating wp query with posts with specific category
- $wp_query->current_post restarts from zero on paged pages
- wp_get_post_terms of cpt but not duplicates if they are used more than once in the loop
- How to prevent queried posts from being added to cache?
- Order posts by meta value and Date
- How to make orderby ‘meta_value_num’ OPTIONAL?
- How to do a query on custom taxonomies that is uncategorised?
- How can I query posts with newly uploaded images?
- Conditional arguments WP_Query for post custom fields
- How do I search inside specific taxonomies in WordPress
- Random loop with code to prevent duplicate output returns no output at all from time to time
- Single meta_query query using OR instead of AND in request’s WHERE statement
- Woocommerce returns Product post_status as published even tho it is in status draft
- remove query arg from url after set query
- How to loop for every result found in the_content() when using the search query?
- if statement in wp_query arguments
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Order By table field comment_status in WordPress > 4.0
- Slow WP_Query for custom post type
- WP_Query Pagination on multiple-loop page breaks WP or doesn’t show up
- Using hook to use DISTINCT in a wp_query
- Overwrite YoastSEO meta-tags with another page’s [closed]
- Import wp users via one click demo option
- How to restrict the search fields for a specific post type
- Slow queries on a huge database
- Pagination links missing for first link (1) and previous button? How to get pagination links to work?
- How to create a WP Cron hooks based on schedules from Advanced cron manager plugin?
- Query with relation and one without relation using multiple taxonomies?
- WP_Query with different postmeta filter for each categories
- Automatically Query Parent Taxonomy
- Shouldn’t I be able to modify the main query by this filter?
- WP Query crashes on more than ~ 2000 posts
- different for loop if screen resolution < 1000px
- insert value from html into data base with wordpress
- Debugging wp_query orderby for taxonomy
- Get all posts which was posted on X Days WordPress
- Pagination is not working with custom query inside a homepage template
- How to load a script code only in posts?
- Display posts with specific value first in query
- wp_query comment and meta query
- Show menus to one admin username
- Get the child category ID of current category
- I need to run a AJAX Fuction from within a WP_Query but only works on first item
- WQ Query post meta date comparison
- Category not being selected
- WP_Query with 4 post meta field arguments gives 500 internal server error
- Limit number of posts in WP_query per month
- How to filter a static post page with ajax and $wp_query
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- how to translate countries output from wp database?
- Custom query does not find pages
- wp-query and wp_get_post_terms on custom taxonomy archive page
- How to combine meta_query and date_query with condition in WordPress
- What’s wrong with this meta query? (order by meta key, then title, doesn’t work)
- ElasticPress is (aparently) messing with my search filters
- get_posts function not returning any results
- INNER JOIN custom tables – SQL Query
- SELECT TOP 1 in wp_query for each groupby meta value
- Get unique post by meta value using wp_query
- WP Query. Ordering posts by another post types meta
- How to display author meta and count numbers for each user in comment.php?
- update_post_meta() not updating
- XMLRPC pingback.extensions.getPingbacks not work with parameters
- Get top 5 posts viewed using post_views_count
- Get posts meta_query by repater field
- WordPress pagination not returning posts on second page
- Track write actions to the database
- How can I use two custom fields in WP Query
- meta_query not working with the_content()
- how to exclude store in clipper theme wordpress code php
- Optimising amount of calls to custom fields
- Issue in If else condition [closed]
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Extract video content from post to display on front page
- Hierarchical List Pages as a table
- WP_Query with several meta_query-statements and order by meta_value
- Second wp_query doesn’t appear to be working
- difference between methods of query
- post__in not recognizing multiple IDs
- Related posts with WP_Query
- How to replecate the _fields parameter in custom REST api endpoint
- wp_query, calculate with two dates when ‘key’ is text format
- Use value from meta key array for use in WP_Query
- WP_Query sort by ACF date field (newest first) with blank dates first