How to call JS in your wordpress plugin

Javascript is really an amazing think, when you are developing any website with good animation, call value without page loading etc.
Wordpress already call latest jquery when call wp_head() function in header.php, but sometimes you want to add own script in plugin. wp_enqueue_script is then useful for you.

<?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?>

$handle : (string) (required) Name used as a handle for the script.

$src : (string) (optional) URL to the script, e.g.

$deps : (array) (optional) Array of the handles of all the registered scripts that this script depends on, that is the scripts that must be loaded before this script. Set false if there are no dependencies.

$ver : (string) (optional) String specifying the script version number, if it has one, which is concatenated to the end of the path as a query string.

$in_footer : (boolean) (optional) Normally, scripts are placed in of the HTML document.

function my_scripts_method() {
	wp_enqueue_script( 'my-script-name', get_template_directory_uri() . '/js/script.js', array(), '1.0.0', true );

add_action( 'wp_enqueue_scripts', 'my_scripts_method' );

How you change wordpress admin footer text

Sometimes you did not want to show default wordpress admin footer and want to replace with your text and logo. This example is for this purpose. So you can easily change wordpress admin footer without any big changes. You just need to copy paste below code in functions.php file.

//change the footer text

function custom_admin_footer_text () {
 echo '<img src="' . plugins_url( 'images/custom-icon.png' , __FILE__ ) . '">Dummy text goes here.';

add_filter( 'admin_footer_text', 'custom_admin_footer_text' );