By default PZ Frontend Manager plugin reset all the site enqueued styles and scripts and enqueue only the plugin's scripts and styles. The purpose of these process is to eliminate scripts and styles that is not needed in the dashboard pages. However the plugin allow your to add your custom script and styles using filter and action hooks.The following code snippets will help you understand on how to include your scripts and styles. copy and paste the code to your theme functions.php file.First, Enqueue your scripts and styles.
/*
* Enqueue scripts and styles.
*/
function my_custom_scripts_callback(){
/*
* Register and enqueue script
* Note: the hanlde of the script must be unique, and change the url based on your file URL
*/
wp_register_script( 'may-custom-scripts', 'www.mydomain.com/js/myscript.js', array(), '1.0.0', true );
wp_enqueue_script( 'may-custom-scripts' );
/*
* Register and enqueue styles
* Note: the hanlde of the script must be unique
*/
wp_register_style( 'may-custom-styles', 'www.mydomain.com/css/styles.css', array(), '1.0.0', true );
wp_enqueue_script( 'may-custom-styles' );
}
add_action( 'wp_enqueue_scripts', 'my_custom_scripts_callback');
Now, You have enqueue scripts and styles you have to register it to the PZ dashboard, scripts and styles using a filter hook. The following code will teach on on how to register your custom scripts and styles.
/*
* Notes use the handle slug to register styles and scripts to PZ dashboard
*
* Register your custom styles
*/
function register_my_custom_styles_callback( $styles ){
$styles[] = 'my-custom-styles';
return $styles;
}
add_filter( 'pzfm_registered_styles', 'register_my_custom_styles_callback' );
/*
* Register your custom scripts
*/
function register_my_custom_scripts_callback( $scripts ){
$scripts[] = 'my-custom-scripts';
return $scripts;
}
add_filter( 'pzfm_registered_scripts', 'register_my_custom_scripts_callback' );