*/ class Lead_Crm_Admin { /** * The ID of this plugin. * * @since 0.1.0 * @access private * @var string $plugin_id The ID of this plugin. */ private $plugin_id; /** * The version of this plugin. * * @since 0.1.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @param string $lead_crm The name of this plugin. * @param string $version The version of this plugin. *@since 0.1.0 */ public function __construct($plugin_id, $version) { $this->plugin_id = $plugin_id; $this->version = $version; } /** * Register the stylesheets for the admin area. * * @since 0.1.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Lead_Crm_Loader as all of the hooks are defined * in that particular class. * * The Lead_Crm_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ if ($this->is_on_plugin_page()) { $path = plugin_dir_url(__FILE__) . 'css/libs/tailwind.min.css'; wp_enqueue_style("{$this->plugin_id}_tailwind", $path, array(), $this->version, 'all'); $path = plugin_dir_url(__FILE__) . 'css/lead-crm-admin.css'; wp_enqueue_style("{$this->plugin_id}_admin", $path, array("{$this->plugin_id}_tailwind"), $this->version, 'all'); } } /** * Register the JavaScript for the admin area. * * @since 0.1.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Lead_Crm_Loader as all of the hooks are defined * in that particular class. * * The Lead_Crm_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ if ($this->is_on_plugin_page()) { $path = plugin_dir_url(__FILE__) . 'js/libs/petite-vue.min.js'; wp_enqueue_script("{$this->plugin_id}_petite-vue", $path, array(), $this->version, false); $path = plugin_dir_url(__FILE__) . 'js/lead-crm-admin.js'; wp_enqueue_script("{$this->plugin_id}_admin", $path, array("{$this->plugin_id}_petite-vue"), $this->version, true); // Pass dynamic page data to the enqueued script (no inline