Showing posts with label wordpress tutorials. Show all posts
Showing posts with label wordpress tutorials. Show all posts

Monday, March 30, 2020

Implementing cron job in WordPress

function myplugin_activate()
{

    if (!wp_next_scheduled('pt_my_task_hook')) {
        //wp_schedule_event(time(), 'hourly', 'pt_my_task_hook');
        //wp_schedule_event(time(), 'every_three_minutes', 'pt_my_task_hook');
        wp_schedule_event(strtotime('22:00:00'), 'daily', 'pt_my_task_hook');
    }
}

register_activation_hook(__FILE__, 'myplugin_activate');

/* Deactivate Hook */
register_deactivation_hook(__FILE__, 'my_deactivation');
function my_deactivation()
{
    wp_clear_scheduled_hook('pt_my_task_hook');
}

add_action('pt_my_task_hook2', 'user_email_task_function');
function user_email_task_function()
{
    // code to implement
}

Tuesday, December 31, 2019

Add JavaScript(JS), JQuery, and CSS to WordPress Site without wp_enqueue...




In this video will learn how we can add JavaScript(JS), JQuery, and CSS to WordPress Site without enqueuing it using Simple Custom CSS and JS. Add JavaScript(JS), JQuery, and CSS from Wp-admin in WordPress and select a particular side you want to implement it. Customize your WordPress site’s appearance by easily adding custom CSS and JS code without even having to modify your theme or plugin files. This is perfect for adding custom CSS tweaks to your site. Plugin url: https://wordpress.org/plugins/custom-css-js/