Hyphens vs. periods in the script slug in wp_register_script?

Use hyphens only. Take a look at wp-includes/script-loader.php: $scripts->add( ‘scriptaculous-sound’, ‘/wp-in $scripts->add( ‘scriptaculous-controls’, ‘/wp $scripts->add( ‘scriptaculous’, ”, array(‘sc // not used in core, replaced by Jcrop.js $scripts->add( ‘cropper’, ‘/wp-includes/js/cr $scripts->add( ‘jquery’, ‘/wp-includes/js/jqu // full jQuery UI $scripts->add( ‘jquery-ui-core’, ‘/wp-include $scripts->add( ‘jquery-effects-core’, ‘/wp-in $scripts->add( ‘jquery-effects-blind’, ‘/wp-i $scripts->add( ‘jquery-effects-bounce’, ‘/wp- $scripts->add( ‘jquery-effects-clip’, ‘/wp-in $scripts->add( ‘jquery-effects-drop’, ‘/wp-in $scripts->add( … Read more

Adding Colorpicker Field To Category

This has been updated for WordPress 4+ with the introduction of Term Meta. The code is heavily commented. :: My Functions – functions.php :: The below function is to display the colorpicker on the “Add New Category” screen: /** * Add new colorpicker field to “Add new Category” screen * – https://developer.wordpress.org/reference/hooks/taxonomy_add_form_fields/ * * @param … Read more

wp_enqueue script my_javascript_file in the footer

You have true set in the 4th parameter (version), not the 5th. wp_enqueue_script( ‘my_javascript_file’, //slug get_template_directory_uri() . ‘/javascripts/app.js’, //path array(‘jquery’), //dependencies false, //version true //footer ); Also, as someone else mentioned, drop jquery enqueue, you’ve got it as a dependency, you don’t need to enqueue it as well. One last thing, your function name has … Read more

Is there a way to set the order of wp_footer hooked functions?

The recommended way is to call your function inside the .js file you are enqueuing. Is there any reason you can’t do that? If you need access to dynamic data like WP options from within your script, use wp_localize_script to initialize a javascript object with the data you need: $data = array(‘some_option’ => get_option(‘an_option_from_my_theme’)); wp_enqueue_script(‘your_script_handle’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)