The cron event needs to be registered on the plugin activation hook like so:
register_activation_hook( __FILE__, 'activate_cron' );
function activate_cron() {
wp_schedule_event( current_time( 'timestamp' ), 'hourly', 'the_function_to_run' );
}
The the_function_to_run
defined in the wp_schedule_event needs to be your function that you want to run at the time interval.
Note: When you say something is “Not Working” it is really hard to answer. Please be more specific to get better answers.
Related Posts:
- Uncaught Error: Call to undefined function wp_generate_attachment_metadata() @ wp-cron
- Schedule WordPress Auto-Updates to only run during business hours
- How to make sure a wp-cron job runs
- How do I email a new page password to somebody every month?
- What happens when wp_cron is deactivated in WordPress?
- Long running action from plugin
- Posts wont expire
- Custom interval is not working
- Cron Job not working in plugin
- How to use wp-ajax in wp-cron
- wp_schedule_single_event function not working
- How ( and mostly at what time ) can i prevent the alternate cron from running?
- action-scheduler vs wp-background-processing
- Remove obsolete plugins artifacts from database tables
- Why is wp-cron only executing on page visit?
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- Cron job not firing
- How make a php script run only with wp-cron
- Does using WP-cron make the site slower for the user?
- wp_schedule_single_event not working: cron job is triggered but nothing gets executed
- How does task scheduler plugin implements cron that is not dependent on page load request? [closed]
- How to make a implement queue for scheduling tasks in WordPress?
- Automatic plugin updates not working
- Setup wp_schedule_event within a custom plugin
- How to set intervals in cron jobs?
- get_edit_post_link() not working on wp-cron
- get_users(); Is an Undefined Function When Used in Cron Job
- Switch from wp-cron to a server cron job
- What causes wp_schedule_single_event to fire off?
- WordPress cron job running more than once
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- Save log for imports in WordPress database – options-table, custom post type or other place?
- Cron: Update four post at Hour
- Activate Plugin Automatically After Set Time
- reminder wp_schedule_event
- get_posts query results out of order but shows correct in php snippets plugin
- Scheduled cron event removed from list automatically after sometime
- WP_CRON issue with UTC and local time
- Better way to run heavy scripts using WordPress database
- wp_schedule_event function reference
- WordPress Cron function is not working
- WordPress crob job performance
- How to customize ‘recurrance’ of’ wp_schedule_event’?
- Adding custom cron_schedule prior to wp_schedule_event
- Using a Cron Job to dynamically populate a field ONCE, and then making the field blank the next time someone visits page
- Plugin Hooks Not Shown in WP Cron Jobs
- Running a function using Crown WordPress on one day a week, for example, Mondays of every week
- Remove WordPress Toolbar buttons
- WP showing “warning: call_user_func_array()”, What to do?
- How can I dequeue a Plugin Stylesheet?
- Adding an admin page – OOP approach not working
- How can I pass a variable to wp_ajax action?
- Declare a function before plugin does on the theme functions.php file
- How to call a function in wordpress plugin from another site
- How can i change an image’s author?
- NextGen Gallery – automatically create gallery sub page?
- How do I make images clickable so as to enlarge them using lightbox?
- FacetWP group listings by custom field [closed]
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- Change wordpress current_time function to different timezone
- Creating custom HTML pages
- How to display the “ratingValue” and “ratingCount” values generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
- Two problems on my WordPress installation [closed]
- Frontent user submit and view content [closed]
- Center and hide overflow of WP toolbar custom links
- get_option error plugin development
- Meta Box by Rilwis, Load metabox on all page templates EXCEPT the homepage
- Best/Correct way to add an option to a category
- Help with WP Business Directory Manager Plugin?
- Loading a plugin’s js file from functions.php
- How-to: This block can only be used once
- How to change WooCommece variation data programmtically [closed]
- Managing wordpress Themes & plugins for multisite
- Programmatically install and activate child-theme
- What makes it possible for a plugin to not able to delete?
- FancyBox JS stopped working on multiple sites. Custom plugin responsible. Urgent help needed
- How do I remove all traces of a plugin?
- How can I add rel=”nofollow” attributes on RSS widgets?
- My CPU usage in A2 Hosting Shared Plan (Turbo Boost) is high due to mysql query!
- Funds Performance system
- How can replace this url
- Plugin Update History
- Display Multiple Photos as Featured Image when mouse moves on to it post
- Issue Saving Posts That Contain Shortcode
- SimpleXML is not working with xml response from external api
- How to use get_blogs_of_user?
- Custom wp_list_tables redirect on specfic page
- Create API for registering user on wordpress site with 3rd party site
- Hook to display element as product on category page
- Fatal error: Out of memory with the Duplicator plugin
- WP Plugin: Print javascript in header
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Add custom fields in the new and edit the site forms without touching the WP core
- Plugin use of ajax/jquery depending dropdown
- Extend WordPress REST API with Scheme Pro Plugin
- Create Landing Page With Login or Subscribe Form [duplicate]
- Filter orders by product in admin
- Get URL for featured image for posts? [closed]
- Store large dataset in WordPress installation temporary
- How to edit the name of a plugin on wordpress.org/plugins