Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to add script in WordPress admin page

/**
 * Enqueue a script in the WordPress admin on edit.php.
 *
 * @param int $hook Hook suffix for the current admin page.
 */
function wpdocs_selectively_enqueue_admin_script( $hook ) {
    if ( 'edit.php' != $hook ) {
        return;
    }
    wp_enqueue_script( 'my_custom_script', plugin_dir_url( __FILE__ ) . 'myscript.js', array(), '1.0' );
}
add_action( 'admin_enqueue_scripts', 'wpdocs_selectively_enqueue_admin_script' );
Comment

PREVIOUS NEXT
Code Example
Php :: laravel query builder sum 
Php :: update onlu one column laravel 
Php :: laravel created_at where date format 
Php :: how to check if there is an authenticated user laravel 
Php :: laravel add item to array 
Php :: php array size 
Php :: remove index.php in codeigniter 
Php :: laravel where like 
Php :: php unset array key 
Php :: eloquent get distinct 
Php :: laravel migrate seed 
Php :: how to add recaptcha to woocommerce register php 
Php :: carbon parse timestamp 
Php :: check session php 
Php :: php month single digit 
Php :: php get ip from host 
Php :: php loop through array of objects 
Php :: how to save file in storage folder in laravel 
Php :: how to add data to an object in php 
Php :: how to replace double quotes in a string in php 
Php :: if is alphabet php 
Php :: laravel form in 24 hours format 
Php :: laravel http retry 
Php :: php cli display errors 
Php :: php remove array element reset keys 
Php :: target class usercontroller does not exist. in laravel 8 
Php :: delete uploaded file php 
Php :: php rsa encryption 
Php :: require in php 
Php :: php pdo check if update query successful 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =