I'm writing a plugin to extend functionality of product page according to the site requirements. I have copied the page edit-product.php in the child theme directory. The theme used is Flatsome.
In the plugin I need to enqueue script and css.
I have read in precedent ticket to use the hook
add_action('marketking_dashboard_head', array($this, 'frontend_enqueue'));
public function frontend_enqueue(){
add_action('wp_print_scripts', function () {
wp_enqueue_script('frontend_pagejs', PluginUtils::$PLUGIN_URL . '/js/frontend-page.js', array('jquery'), '1.0'); });
}
An then I have done as I read:
"...MarketKing completely disconnects the dashboard from default styles and scripts - we did this because we want to preserve the specific design of the dashboard, regardless of theme and other plugins, and prevent conflict.
Copy the marketking-dashboard-login.php file (from marketking core / public / dashboard) to your child theme, and edit it there.
In that file you will find lines of code that start with:
$wp_styles->queue =
$wp_scripts->queue =
"
For me doesn't work. I work just if I modify marketking-dashboard-login.php in your plugin directory.
To Sum up, I just want to know how to properly load custom js and css in the edit-product.php using wp_enqueue_script and wp_enqueue_style.
Thank you!
