Yes, delete_expired_transients
is a cron event that runs once per day and the function delete_expired_transients()
is automatically called when the cron event runs — see wp-includes/default-filters.php. So you do not need to call the function manually like you did in your my_custom_fn()
function.
And if you use a plugin like WP Crontrol, you can easily view the cron events in your site and the actions (functions) that will be called when a specific cron event runs.
Related Posts:
- WP_Cron doesn’t do the job: Multisite stats
- HELP: Code To Check Status And Write Debug Entry
- Remove Actions/Filters added via Anonymous Functions
- Trying to use add_action and do_action with parameters
- Check if post is being published for the first time, or is an already published post being updated
- How to use the do_action () with parameter
- Perform an action when post is updated/published
- WordPress Theme Update Action?
- Extract image from content and set it as the featured image
- Refresh page after form action
- How to restrict actions and filters “properly” by conditions
- How to count number of functions attached to an action hook?
- Add action hook conditionally – only when home.php in use
- Using add_filter() in Widgets
- How can I tell if I’m on a login page? [duplicate]
- Change meta tags programatically
- Convert hyphen to underscore in permalinks
- Using get_terms for custom taxonomy in functions.php
- Fatal error: Call to undefined function add_action() – an untouched problem
- Reuse variable in hook callback
- Call to undefined add_action() in theme’s functions.php
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Can’t Update function.php after writing short code
- How to update feed only 2-3 times a week (for Feedburner email)?
- How would go about if I just want a temporary function?
- Passing arguments to my function with do_action and add_action is not working
- Pass parameters to function through an action
- Accepted arguments value in hook functions
- How to select a page within admin?
- How to manage arrays from custom functions stored in functions.php?
- How do I pass arguments for multiple functions hooked to a single action?
- Which action hook to use for function?
- Custom HTML in specific category single page and its descendant categories
- Modify a function without editing template
- Which action does wp_update_user triggers?
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- Create cron job for update translations automatically
- Reuse variable in hook callback
- Wait a result before enqueue
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Function added using `add_action()` not being called
- Difference b/w Simple function call & do_action call
- jQuery does not work
- Override the WordPress core function wp_referer_field
- Set Taxonomy based on post status
- Two functions with different arguments and add_actions, but identical code
- WordPress function, Run using Crontab
- add_action template_redirect not working for home page
- AMP – Change rel=”canonical” from functions.php [closed]
- Scripts not loading when using the wp_enqueue_scripts action
- Is there a way to prevent a function/method from being called outside a specific hook?
- Auto-Tweet if Type is ‘Status’ using OAuth
- Missing argument for the function
- current_user_can comma list vs OR (||) list
- Adding code before post title with the_title produces weird results
- Add back in child theme what the parent theme removed with remove_action
- login_headertitle is deprecated since version 5.2.0
- Init action and refresh page after form action
- 400 Bad Request – JavaScript App calling Custom wp-json endpoint
- Changing where my author box is printed
- Insert Content Before div#main from the functions.php File
- Problem in using Customizer
- Problem with custom function when I go back with the browser
- Replace admin header logo with an image
- Display a random tag but using cron to control frequency of change
- How do I find the code executed when wp_head() is called?
- template_redirect action only firing if logged in
- How to use wp_enqueue_script properly?
- Bulk updating a group of WordPress Pages every 10 minutes
- Issue passing action class to nested function. Admin Columns
- How to Override Page Template if URL matches query?
- Save_post – Warning: Cannot modify header information
- Writing a function for WP Cron to run a SQL command daily
- How do I trigger WP CLI DB export using a PHP function?
- If has action not working as expected
- Deleting guests profile users after 1.5 hours
- Modifying a WordPress Plugin
- Is_Page doesnt detect my page
- How do you insert code into the sidebar?
- Scheduled post delete – can’t pass the cron arguments
- How to show only specific category post by user role without plugin and restrict all other cats
- Postback redirect through add_action is not triggered
- Remove action hook from Class, understanding OOP
- How to change form action of wp-login page with a function
- Which method is more correct for removing WooCommerce Extensions menu item?
- WordPress hooks to call a function inside a construct
- Fatal error: Call to undefined function add_action() – an untouched problem
- Pass arguments to function class with do_action()
- custom COOKIE on custom page
- What add_action reference should I be using or should I use do_action?
- Getting error while trying to use custom comment function
- Settings in functions.php used by a plugin
- Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
- Show the online status of the current post’s author
- function to return comma separated list of meta values
- Working function() doesn’t execute when triggered by WP CRON
- Update post meta with wp cron
- delete_term is not working properly with add_action()
- How to get variable from other function inside class function using add_action for Ajax call