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
- 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
- Cron Job not working in plugin
- 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
- WordPress “wp cron event run” as Siteground cron job
- Cron Job not working
- Which approach for managing automatic updates would be more robust?
- ‘Global’ settings page for multisite plugin
- What Are Security Best Practices for WordPress Plugins and Themes? [closed]
- How can I add a featured image to a page?
- How can I log a user out of WordPress before the page loads?
- What does a security risk in a plugin look like?
- How to generate/update a XML sitemap without plugins?
- How to assign user a role if none is present when logging in
- update_meta_user difference in i:1 and b:1, how to write b:1
- How to get list of Scripts in Order of Dependencies
- TechCrunch WP Asynchronous Tasks plugin still works on v4.7.5? [closed]
- Trigger Autosave or disable unsaved changes dialog
- How To Clean The Malware Infected & Hacked WordPress Websites? [duplicate]
- Re-naming a theme/child theme whilst maintaining updates
- Get posts from WP_Query and format them on admin_head
- Can’t Update or Delete Plugins From WordPress
- Set and access global variable
- Insert content of a post into another
- WordPress metaboxes – textfield suggestion automatically populated
- Child Themes and Updating Parent Theme
- How to write “alt” tag in image for wordpress code?
- How do I rename a category in the menu bar only?
- A plugin that downloads other plugins
- Large amount image data transfer
- CMB2 field not showing on front end category page
- is it possible to hook every page style?
- I need a lightbox plugin that will apply to gallery [closed]
- how to make a wplang for network fill automatically
- Adding a Tag Parameter / Filter to My Shortcode
- Ajax call not working in wordpress through a plugin
- Setting Author on CPT
- HTTP Error upload ( localhost )
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- Highlight admin menu items that are parent of existing core items
- Getting all woocommerce products from REST API call in plugin
- how does a plugin get active in wordpress
- How do I run my custom function in my plugin when a wordpress user is deleted?
- Page Contents showing in Footer Area
- Update (a function) post’s featured image as soon as $image_url changes
- Widget logic using woocommerce product category
- Surviving WordPress and plugin updates
- How to order users alphabetically by name? in plugin UPME
- WordPress Background Audio – Continous AutoPlay
- Why won’t the Comprehensive Google Map Plugin load?
- How to change a specific page to custom page?
- How use Dynamic hyperlink on each wordpress post?
- How to execute init or woocommerce_init only for checkout page
- wordpress jquery is not defined because the head tag is empty
- Questions about using Disqus or Jetpack for comments [closed]
- Adding fontAwesome to Primary Menu returns after saving the menu
- I start to make custom plugin but for some reason is not working, i get no error. Can someone help me? Thanks