本文整理汇总了PHP中wp_clear_scheduled_hook函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_clear_scheduled_hook函数的具体用法?PHP wp_clear_scheduled_hook怎么用?PHP wp_clear_scheduled_hook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_clear_scheduled_hook函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cron
/**
* Set up crons. CLear any existing scheduled hooks, and add ours.
*
* @since Astoundify Crowdfunding 1.6
*
* @return void
*/
public static function cron()
{
wp_clear_scheduled_hook('atcf_check_for_completed_campaigns');
wp_schedule_event(time(), 'hourly', 'atcf_check_for_completed_campaigns');
wp_clear_scheduled_hook('atcf_process_payments');
wp_schedule_event(time(), 'hourly', 'atcf_process_payments');
}
示例2: uninstall
function uninstall()
{
global $wpdb, $table_prefix;
// get name of subscribe2 table
$this->public = $table_prefix . "subscribe2";
// delete entry from wp_options table
delete_option('subscribe2_options');
// delete legacy entry from wp-options table
delete_option('s2_future_posts');
// remove and scheduled events
wp_clear_scheduled_hook('s2_digest_cron');
// delete usermeta data for registered users
$users = $wpdb->get_col("SELECT ID FROM {$wpdb->users}");
if (!empty($users)) {
foreach ($users as $user) {
$cats = explode(',', get_usermeta($user, 's2_subscribed'));
if ($cats) {
foreach ($cats as $cat) {
delete_usermeta($user, "s2_cat" . $cat);
}
}
delete_usermeta($user, 's2_subscribed');
}
}
// drop the subscribe2 table
$sql = "DROP TABLE IF EXISTS `" . $this->public . "`";
mysql_query($sql);
}
示例3: run
/**
* Setup the module's functionality
*
* Loads the file change detection module's unpriviledged functionality including
* performing the scans themselves
*
* @since 4.0.0
*
* @return void
*/
function run()
{
global $itsec_globals;
$this->settings = get_site_option('itsec_file_change');
$this->running = false;
$this->excludes = array('file_change.lock', $itsec_globals['ithemes_backup_dir'], $itsec_globals['ithemes_log_dir'], '.lock');
$interval = 86400;
//Run daily
// If we're splitting the file check run it every 6 hours.
if (isset($this->settings['split']) && true === $this->settings['split']) {
$interval = 12342;
}
add_filter('itsec_logger_modules', array($this, 'itsec_logger_modules'));
add_filter('itsec_sync_modules', array($this, 'itsec_sync_modules'));
//register sync modules
add_action('itsec_execute_file_check_cron', array($this, 'execute_file_check'));
//Action to execute during a cron run.
if ((!defined('DOING_AJAX') || DOING_AJAX === false) && isset($this->settings['enabled']) && true === $this->settings['enabled'] && isset($this->settings['last_run']) && $itsec_globals['current_time'] - $interval > $this->settings['last_run'] && (!defined('ITSEC_FILE_CHECK_CRON') || false === ITSEC_FILE_CHECK_CRON)) {
wp_clear_scheduled_hook('itsec_file_check');
add_action('init', array($this, 'execute_file_check'));
} elseif (defined('ITSEC_FILE_CHECK_CRON') && true === ITSEC_FILE_CHECK_CRON && !wp_next_scheduled('itsec_execute_file_check_cron')) {
//Use cron if needed
wp_schedule_event(time(), 'daily', 'itsec_execute_file_check_cron');
}
}
示例4: delete_transient
/**
* @since 1.4
* @return array
*/
public function &upgrade()
{
$major_version = (double) $this->options['version'];
if ($major_version < 1.3) {
$this->upgradeOptionsUpTo_1_2_2();
// Here the backup() method must be called after upgradeOptionsUpTo_1_2_2()
// to let the latter merge the two arrays of options.
$this->backup();
delete_transient('sitetree');
delete_option('sitetree_content');
} elseif ($major_version < 1.4) {
$this->backup();
$this->upgrade_1_3_Options();
delete_transient('sitetree');
delete_transient('sitetree_xml');
wp_clear_scheduled_hook('sitetree_rebuild');
wp_clear_scheduled_hook('sitetree_rebuild', array('xml'));
} elseif ($major_version < 1.5) {
$this->backup();
$this->upgrade_1_4_Data();
} elseif ($this->options['version'] === '1.5') {
$this->restoreAndUpgradeExceptionsLostWith_1_5();
} else {
return $this->options;
}
return $this->newOptions;
}
示例5: __construct
/**
* Sets up gateaway and adds relevant actions/filters
*/
function __construct()
{
//Booking Interception
if ($this->is_active() && absint(get_option('em_' . $this->gateway . '_booking_timeout')) > 0) {
$this->count_pending_spaces = true;
}
parent::__construct();
$this->status_txt = __('Awaiting PayPal Payment', 'em-pro');
add_action('admin_enqueue_scripts', array(&$this, 'gateway_admin_js'));
if ($this->is_active()) {
add_action('em_gateway_js', array(&$this, 'em_gateway_js'));
//Gateway-Specific
add_action('em_template_my_bookings_header', array(&$this, 'say_thanks'));
//say thanks on my_bookings page
add_filter('em_bookings_table_booking_actions_4', array(&$this, 'bookings_table_actions'), 1, 2);
//add_filter('em_my_bookings_booking_actions', array(&$this,'em_my_bookings_booking_actions'),1,2);
//set up cron
$timestamp = wp_next_scheduled('emp_paypal_cron');
if (absint(get_option('em_paypal_booking_timeout')) > 0 && !$timestamp) {
$result = wp_schedule_event(time(), 'em_minute', 'emp_paypal_cron');
} elseif (!$timestamp) {
wp_unschedule_event($timestamp, 'emp_paypal_cron');
}
} else {
//unschedule the cron
wp_clear_scheduled_hook('emp_paypal_cron');
}
}
示例6: relevanssi_clear_database_tables
function relevanssi_clear_database_tables()
{
global $wpdb;
if (defined('RELEVANSSI_PREMIUM')) {
return;
}
// Relevanssi Premium exists, do not delete the tables
wp_clear_scheduled_hook('relevanssi_truncate_cache');
$relevanssi_table = $wpdb->prefix . "relevanssi";
$stopword_table = $wpdb->prefix . "relevanssi_stopwords";
$log_table = $wpdb->prefix . "relevanssi_log";
$relevanssi_cache = $wpdb->prefix . 'relevanssi_cache';
$relevanssi_excerpt_cache = $wpdb->prefix . 'relevanssi_excerpt_cache';
if ($wpdb->get_var("SHOW TABLES LIKE '{$stopword_table}'") == $stopword_table) {
$sql = "DROP TABLE {$stopword_table}";
$wpdb->query($sql);
}
if ($wpdb->get_var("SHOW TABLES LIKE '{$relevanssi_table}'") == $relevanssi_table) {
$sql = "DROP TABLE {$relevanssi_table}";
$wpdb->query($sql);
}
if ($wpdb->get_var("SHOW TABLES LIKE '{$log_table}'") == $log_table) {
$sql = "DROP TABLE {$log_table}";
$wpdb->query($sql);
}
if ($wpdb->get_var("SHOW TABLES LIKE '{$relevanssi_cache}'") == $relevanssi_cache) {
$sql = "DROP TABLE {$relevanssi_cache}";
$wpdb->query($sql);
}
if ($wpdb->get_var("SHOW TABLES LIKE '{$relevanssi_excerpt_cache}'") == $relevanssi_excerpt_cache) {
$sql = "DROP TABLE {$relevanssi_excerpt_cache}";
$wpdb->query($sql);
}
echo '<div id="message" class="updated fade"><p>' . __("Data wiped clean, you can now delete the plugin.", "relevanssi") . '</p></div>';
}
示例7: check_cron
/**
* Check whether WP Cron needs to add new task.
*/
public function check_cron()
{
if (!is_admin()) {
return;
}
// set wp cron task
if (Post_Views_Counter()->get_attribute('options', 'general', 'cron_run')) {
// not set or need to be updated?
if (!wp_next_scheduled('pvc_reset_counts') || Post_Views_Counter()->get_attribute('options', 'general', 'cron_update')) {
// task is added but need to be updated
if (Post_Views_Counter()->get_attribute('options', 'general', 'cron_update')) {
// remove old schedule
wp_clear_scheduled_hook('pvc_reset_counts');
// set update to false
$general = Post_Views_Counter()->get_attribute('options', 'general');
$general['cron_update'] = false;
// update settings
update_option('post_views_counter_settings_general', $general);
}
// set schedule
wp_schedule_event(Post_Views_Counter()->get_instance('counter')->get_timestamp(Post_Views_Counter()->get_attribute('options', 'general', 'reset_counts', 'type'), Post_Views_Counter()->get_attribute('options', 'general', 'reset_counts', 'number')), 'post_views_counter_interval', 'pvc_reset_counts');
}
} else {
// remove schedule
wp_clear_scheduled_hook('pvc_reset_counts');
remove_action('pvc_reset_counts', array(&$this, 'reset_counts'));
}
}
示例8: install_jobroller
function install_jobroller()
{
// define vars
global $app_theme, $app_version, $jr_log, $wp_rewrite;
$jr_log->clear_log();
// Clear cron
wp_clear_scheduled_hook('get_indeed_jobs');
wp_clear_scheduled_hook('check_indeed_jobs');
wp_clear_scheduled_hook('jr_get_indeed_jobs');
wp_clear_scheduled_hook('jr_check_indeed_jobs');
wp_clear_scheduled_hook('check_if_jobs_have_expired');
wp_clear_scheduled_hook('jr_check_jobs_expired');
wp_clear_scheduled_hook('get_indeed_jobs');
wp_clear_scheduled_hook('get_indeed_jobs');
wp_clear_scheduled_hook('appthemes_update_check');
update_option('jr_get_indeed_jobs', 'no');
update_option('jr_check_jobs_expired', 'no');
update_option('jr_indeed_xml_index', '0');
// insert the default values
jr_default_options();
// insert additional default values
jr_default_values();
// run the table install script
jr_tables_install();
// create pages and assign templates
jr_create_pages();
// insert the default job types
jr_create_cats();
// insert the default links
jr_insert_links();
//flush the rewrite rules so the new custom post types will automatically work
$wp_rewrite->flush_rules();
}
示例9: onDeactivation
public static function onDeactivation()
{
$sources = get_option(self::PREFIX . '_sources');
unset($sources[self::SERVICE]);
update_option(self::PREFIX . '_sources', $sources);
wp_clear_scheduled_hook(self::PREFIX . '_parse', array(self::SERVICE));
}
示例10: wp_rss_multi_deactivation_event
function wp_rss_multi_deactivation_event()
{
wp_clear_scheduled_hook('wp_rss_multi_event_importfeeds');
wp_clear_scheduled_hook('wp_rss_multi_event_feedtopost');
wp_clear_scheduled_hook('wp_rss_multi_event_delete_custom_posts');
wp_clear_scheduled_hook('wp_rss_multi_event');
}
示例11: cp_schedule_expire_check
function cp_schedule_expire_check()
{
global $cp_options;
$recurrance = $cp_options->ad_expired_check_recurrance;
if (empty($recurrance)) {
$recurrance = 'daily';
}
// clear schedule if prune ads disabled or recurrance set to none
if (!$cp_options->post_prune || $recurrance == 'none') {
if (wp_next_scheduled('cp_ad_expired_check')) {
wp_clear_scheduled_hook('cp_ad_expired_check');
}
return;
}
// set schedule if does not exist
if (!wp_next_scheduled('cp_ad_expired_check')) {
wp_schedule_event(time(), $recurrance, 'cp_ad_expired_check');
return;
}
// re-schedule if settings changed
$schedule = wp_get_schedule('cp_ad_expired_check');
if ($schedule && $schedule != $recurrance) {
wp_clear_scheduled_hook('cp_ad_expired_check');
wp_schedule_event(time(), $recurrance, 'cp_ad_expired_check');
}
}
示例12: register
public static function register()
{
TMM_Event::init();
//TMM_GoogleCalendar::init();
$args = array('labels' => array('name' => __('Events', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'singular_name' => __('Event', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'add_new' => __('Add New', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'add_new_item' => __('Add New Event', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'edit_item' => __('Edit Event', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'new_item' => __('New Event', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'view_item' => __('View Event', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'search_items' => __('Search In Events', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'not_found' => __('Nothing found', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'not_found_in_trash' => __('Nothing found in Trash', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'parent_item_colon' => ''), 'public' => true, 'archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => true, 'menu_position' => null, 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'tags', 'comments'), 'rewrite' => array('slug' => 'event'), 'show_in_admin_bar' => true, 'taxonomies' => array('events-categories'), 'menu_icon' => 'dashicons-calendar');
register_post_type('event', $args);
//*** taxonomies ****
register_taxonomy("events-categories", array("event"), array("hierarchical" => true, "labels" => array('name' => __('Events Categories', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'singular_name' => __('Event category', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'add_new' => __('Add New', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'add_new_item' => __('Add New Event category', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'edit_item' => __('Edit Event category', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'new_item' => __('New Event category', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'view_item' => __('View Event category', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'search_items' => __('Search Events categories', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'not_found' => __('No Events categories found', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'not_found_in_trash' => __('No Events categories found in Trash', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'parent_item_colon' => ''), "singular_label" => __("Events", TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'public' => true, "show_tagcloud" => true, 'query_var' => true, "rewrite" => true, 'show_in_nav_menus' => true, 'capabilities' => array('manage_terms'), 'show_ui' => true));
add_filter("manage_event_posts_columns", array('TMM_Event', "show_edit_columns"));
add_action("manage_event_posts_custom_column", array('TMM_Event', "show_edit_columns_content"));
//***
add_filter("manage_edit-event_sortable_columns", array('TMM_Event', "event_sortable_columns"));
add_action('pre_get_posts', array('TMM_Event', "event_column_orderby"));
if (class_exists('TMM')) {
$events_set_old_ev_to_draft = TMM::get_option("events_set_old_ev_to_draft");
if ($events_set_old_ev_to_draft) {
//set crone
add_action('old_events_shedules', array(__CLASS__, 'old_events_shedules'));
if (!wp_next_scheduled('old_events_shedules')) {
wp_schedule_event(time(), 'hourly', 'old_events_shedules');
}
} else {
wp_clear_scheduled_hook('old_events_shedules');
}
}
}
示例13: stop
function stop()
{
if ($this->is_active()) {
pnfw_log(PNFW_FEEDBACK_PROVIDER_LOG, __("Un-scheduled Feedback Provider.", 'pnfw'));
wp_clear_scheduled_hook('pnfw_feedback_provider_event');
}
}
开发者ID:benediktharter,项目名称:push-notifications-for-wp,代码行数:7,代码来源:class-pnfw-ios-feedback-provider.php
示例14: init
/**
* Plugin deactivation actions
*
* @since 1.4.0
* @change 1.4.0
*/
public static function init()
{
/* Delete transients */
delete_transient('statify_data');
/* Delete cron event */
wp_clear_scheduled_hook('statify_cleanup');
}
示例15: tin_clear_newsletter_event
function tin_clear_newsletter_event()
{
global $pagenow;
if ('themes.php' == $pagenow && isset($_GET['activated'])) {
wp_clear_scheduled_hook('tin_newsletter_weekly_hook');
}
}