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
- WordPress “wp cron event run” as Siteground cron job
- Cron Job not working
- Which approach for managing automatic updates would be more robust?
- How to maintain W3C standards compliance of a theme
- Load plugin on specific page only
- Does a plugin’s “main” file need to be named the same as the folder containing it?
- Plugin or mod for wordpress to make content publication SUPER easy
- enqueue script only if it is not already enqueue
- Display (and manage) webcam images?
- Overwrite textdomain of plugins by default – Lost Translation
- jQuery plugin only in one page/post
- Google Analytics post views in WordPress? [closed]
- Hook (upgrader_process_complete) running moment
- Can’t see login page after migration
- How to import 55k images (uploaded via FTP) into WordPress Media libary? [closed]
- Debugging Technique Question re: functions.php
- Custom Taxonomy Tag Search
- An issue with SEO Ultimate
- How do I modify the position of a plugin?
- Add a custom form on the post-new.php admin page
- how to give a user a role?
- Trouble with editing template for “List category posts” plugin
- How to show WP addon installation path during installation?
- Replace default og:image tag YOAST
- Fromcraft Plugin On click submit button [closed]
- A include_template Question
- flush_rewrite_rules() not working with update_option_{$option}
- How to ignore extra whitespaces in translation functions like _e?
- Can backlinks to my site increase my chances of plugin rejection
- Price comparison table based on Custom Post Type?
- How do I determine if the user who registered is not spam?
- display unique post per category
- Plugin to send messages to members/lists but not full-blown newsletters
- Plugin prevents code from working
- Determining Whether Automatic Upgrade will Fail?
- Add Plugin broken after removing Booster for Woocommerce
- WP_CONTENT_DIR disables plugin directory
- WordPress Custom Hook with Class method
- Undefined index: custom_post_template_present
- Ensure WordPress Theme Uninstalls Completely
- Image path in childs theme
- Warning: sprintf(): Too few arguments in nav-menu-template.php
- how to insert thousands of posts faster?
- Coupon Codes for product discount combined with conditional free shipping
- How to fix slow comment query?
- Sending post data over REST API, how to parse shortcodes in post_content?
- Primary Menu doesn’t show because of w3 cache
- Wp Ecommerce Reposition Product Page Product Thumbnail Image
- How to test a WordPress plugin on a single post?
- Plugin and javascript placement
- Disable plugin function
- How to validate password length in wordpress
- URL Redirect on GoDaddy platform [closed]