Last active
September 9, 2020 11:30
-
-
Save fabriziofeitosa/b126136ff9d82b5edb1955c9ee17e368 to your computer and use it in GitHub Desktop.
(WP) Criando atividade CRON WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Verifica se existe, se não criará | |
if ( ! wp_next_scheduled( 'cron_get_price_node_js' ) ) { | |
// O valor 'twicedaily' é um valor para executar duas vezes ao dia. Recomendo ter o CODEX da função para saber mais | |
// TEMPO , 'de quando em quanto tempo' , 'nome do action' | |
wp_schedule_event( time(), 'twicedaily', 'cron_get_price_node_js' ); | |
} | |
// 'nome do action' , 'nome da função que deverá ser chamada' | |
add_action( 'cron_get_price_node_js', 'update_allurl_pricenodejs_admin_action' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment