Нужна помощь wp_cron
-
Здравствуйте.
Есть плагин:
Нужно его доработать. Я хочу, чтобы функция gsxml_generate_xmlsitemap() обновлялась 1 раз в сутки в нужно мне время, например в 24.00 часов. Если есть желающие помочь, пишите на почту rozhnovvv@gmail.com<?php /* Plugin Name: Snippet XML Version: 1.0 Plugin URI: Description: Author: Author URI: */ if (!defined('ABSPATH')) die("Aren't you supposed to come here via WP-Admin?"); //Pre-2.6 compatibility if ( ! defined( 'WP_CONTENT_URL' ) ) define( 'WP_CONTENT_URL', get_bloginfo( 'wpurl' ) . '/wp-content' ); if ( ! defined( 'WP_CONTENT_DIR' ) ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); if ( ! defined( 'WP_PLUGIN_URL' ) ) define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' ); if ( ! defined( 'WP_PLUGIN_DIR' ) ) define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); /* Genarates the actual XML sitemap file on the server */ function gsxml_generate_xmlsitemap() { //код функции } function activate_gsxml () { gsxml_generate_xmlsitemap(); } //register_activation_hook(WP_PLUGIN_DIR.'/snippet-xml/snippet-xml.php', 'generate_xmlsitemap'); register_activation_hook(WP_PLUGIN_DIR.'/snippet-xml/snippet-xml.php','activate_gsxml'); add_action ( 'activate_plugin', 'gsxml_generate_xmlsitemap' ); ?>
Просмотр 1 ответа (всего 1)
Просмотр 1 ответа (всего 1)
- Тема «Нужна помощь wp_cron» закрыта для новых ответов.