sajtdavid
Forum Replies Created
-
This might be helpful:
I had empty page_for_posts option (as I had custom page for listing news), but each news generated invalid breadcrumb with id = ‘0’ as second element. Quick and dirty solution was to filter them out using this code:add_filter( 'wpseo_breadcrumb_links', function ( $links ) { $remove = null; foreach($links as $i => $link) { if (empty($link['id']) || $link['id'] == '0') { $remove = $i; } } if (!empty($remove)) { unset($links[$remove]); } return $links; });- This reply was modified 6 years, 8 months ago by sajtdavid.
Forum: Plugins
In reply to: [Contact Form 7] Recaptcha v3 loaded from ajax not wokring in 5.1.1In my case, I had to enable recaptcha on an AJAX loaded form. This helped me:
PHP; register the scripts as the form is loaded by ajax:if ( ! wp_script_is( 'google-recaptcha', 'registered' ) ) { wpcf7_recaptcha_enqueue_scripts(); } wp_enqueue_script( 'google-recaptcha' );JS; init service after form is added:
recaptchaCallback();Forum: Hacks
In reply to: Cron problemOkay, still thank you very much.
I’m still in trouble with these cron jobs. I’m using the plugin that I linked before which shows my tasks good, after I bypassed the 10 minute minute check in the core (did not figure out why didn’t let it run my script since there was 5 hour difference between the events, but added not my hook condition to the return so it adds my events now).
The function that I called was running perfectly if I called from site, but on cron did nothing. After some time (and pain) I figured out get_home_path is not available if its a cron job.
Basicly I tried to delete a folder. Recursive delete function did not work. Added code to email me the result for rename, and called it from the site. I got true. Scheduled an event calling the same function, and I got false.
It almost drove me crazy, then I changed the whole wp-content directory’s permissions to 777, and after that I was able to rename directories.
WP Cron in wordpress is kinda evil.
Forum: Hacks
In reply to: Cron problemI see now how is it 10 minutes, thanks for explaining that.
I understand that its problem on small sites, but its not the case, we got a quite busy site.
One thing I still dont understand, why does wp_get_schedule returns false?Forum: Hacks
In reply to: Cron problemAlso, MINUTE_IN_SECONDS = 60, and the code is: $timestamp + 10 * MINUTE_IN_SECONDS. Does this means that, I can’t schedule event in 10 hours before an other event?