New answers tagged wp-cron
0
Use shortcodes, e.g create an iframe shortcode, then you'd be able to do:
[iframe]example.com[/iframe]
Here's code to implement such a shortcode:
add_shortcode('iframe', array('iframe_shortcode', 'shortcode'));
class iframe_shortcode {
function shortcode($atts, $content=null) {
extract(shortcode_atts(array(
'url' => ...
0
WARNING !!!
Always make validation of the data you are saving into the database! This answer below assumes that you validate the content of your post inside of your custom function that you trigger via cron!
I find solution to this problem of stripping iframe and object tags.
NOTICE! Put this only in your plugin's function code that is run via wp cron. ...
6
Neither.
register_activation_hook( __FILE__, 'trigger_me' );
function trigger_me() {
if ( !wp_next_scheduled( 'my_plugin_cron' ) ) {
wp_schedule_event(time(), 'hourly', 'my_plugin_cron');
}
}
Why parse code on every request when you don't need to?
2
This is the intended use of the WP_CRON_LOCK_TIMEOUT constant.
When WordPress is loaded, it checks to see if a cron job is running (if cron is locked). If cron is not locked, it will try to create a lock - if the lock timeout has not been reached, no lock can be acquired and cron is not run.
If no cron job is running, and the timeout has passed (meaning a ...
0
I actually found out that the Cron works, just not as I expected. I refreshed the pages and called wp-cron.php (using wget) a couple of times, and I kept seeing my cron task schedule with "-X seconds". Then I stopped for a minute or two, and refreshed the frontend page of the site, and my Cron task got called.
When it was time for the second scheduled ...
1
Why don't you just create a cron job, make a database dump and look where the info about the cron job is kept? That's what I did. As suspected, WordPress 3.5.1 keeps its cron jobs in the {wp}_options table under the name 'cron'.
SELECT *
FROM `wp_options`
WHERE `option_name` LIKE '%cron%'
Or through functions.php:
$cron_jobs = get_option( 'cron' );
...
2
I believe by default these folders are created by user interaction, however, it's possible that a plugin may be calling a function to create these monthly upload folders.
Note that using this function will create a subfolder in your Uploads folder corresponding to the queried month (or current month, if no $time argument is provided), if that folder is ...
Top 50 recent answers are included
