Last active
July 30, 2019 20:46
-
-
Save thiagotmendes/9ffb10cc3ac0607fbc79698a7ef9af27 to your computer and use it in GitHub Desktop.
This file contains 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 | |
function custom_theme_scripts() { | |
$date = date("dmy"); // apenas gera uma numeração de versão aleatória | |
// seta seu principal arquivo javascript | |
wp_enqueue_script( 'funcoes', get_template_directory_uri() . '/assets/js/scripts.min.js', array('jquery'), $date, true ); | |
// registra uma função js para localizar uma função PHP | |
wp_localize_script( 'funcoes', 'disparaLoad', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); | |
} | |
add_action('wp_enqueue_scripts', 'custom_theme_scripts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment