Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Calling the JS file via WP PHP

function md_view_packages_option() {
  if ($GLOBALS['pagenow'] !== 'nav-menus.php' && ($GLOBALS['pagenow'] !== 'post.php' && $GLOBALS['typenow'] !== 'page')) return;
  wp_enqueue_script( 'md-view-package-option', get_template_directory_uri() . '/lib/md-view-package.js', array(), '1.0', false );
}
add_action('admin_enqueue_scripts', 'md_view_packages_option');
 
PREVIOUS NEXT
Tagged: #Calling #JS #file #WP #PHP
ADD COMMENT
Topic
Name
5+3 =