prefix . $quotes_table_name; $products_table = $wpdb->prefix . $products_table_name; $profiles_table = $wpdb->prefix . $profiles_table_name; $items_table = $wpdb->prefix . $items_table_name; // Define the available profile types $profile_types = [ 'all', 'client', 'contact', 'executive', 'designer', ]; // Sanitize and validate the limit and page parameter for pagination $pagination_limit = isset($_GET["limit"]) && is_numeric($_GET["limit"]) ? $_GET["limit"] : 10; $pagination = isset($_GET["pagination"]) && is_numeric($_GET["pagination"]) ? $_GET["pagination"] * $pagination_limit : 0; // Define the path to the directory containing function files. $functions_url = $path . "/functions/"; // Get the list of function files $files_functions = array_diff(scandir($functions_url), array('..', '.')); // Include each function file foreach ($files_functions as $item) { $item_path = $functions_url . $item; // Check if it's a directory if (is_dir($item_path)) { // Get the list of files inside the directory $files_inside_folder = array_diff(scandir($item_path), array('..', '.')); // Loop through each file inside the directory foreach ($files_inside_folder as $file) { $file_path = $item_path . '/' . $file; // Include the file if it's a PHP file if (is_file($file_path) && pathinfo($file_path, PATHINFO_EXTENSION) == 'php') { include_once($file_path); } } } else { // Include the file if it's a PHP file directly within the directory if (is_file($item_path) && pathinfo($item_path, PATHINFO_EXTENSION) == 'php') { include_once($item_path); } } } // Get categories $categories_ = get_terms(array( 'taxonomy' => 'category', 'hide_empty' => false, )); // Create an array to store the categories foreach ($categories_ as $category) { if ($category->parent) { $category_parent = get_term($category->parent, 'category'); $parent_name = $category_parent ? $category_parent->name : ''; $categories[$category->term_id]= $parent_name. ": ". $category->name; }else{ $categories[$category->term_id]= $category->name; } } asort($categories); function enqueue_quoter_assets() { // Enqueue jQuery from CDN wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-3.6.4.min.js', array(), '3.6.4', true); // Enqueue the custom script with jQuery as a dependency wp_enqueue_script('quoter-script-functions', plugin_dir_url(__FILE__) . 'files/js/functions.min.js', array('jquery'), '1.0', true); // Enqueue the custom style wp_enqueue_style('quoter-css-styles', plugin_dir_url(__FILE__) . 'files/css/styles.css', array(), '1.0'); } add_action('admin_enqueue_scripts', 'enqueue_quoter_assets'); // Include the file containing translated strings include($path . 'strings.php'); $quote_states = array( 'pending' => tran('status_pending'), 'draft' => tran('status_draft'), 'active' => tran('status_active'), 'expired' => tran('status_expired'), 'approved' => tran('status_approved'), 'paid' => tran('status_paid'), 'hold' => tran('status_hold'), 'disapproved' => tran('status_disapproved') ); // Load quote page data include($path . 'contents/quote/quote.php'); include($path . 'contents/quote/create.php'); include($path . 'contents/quote/preview.php'); include($path . 'contents/quote/summary.php'); // Load profile page data include($path . 'contents/profile/profile.php'); include($path . 'contents/profile/create.php'); // Load product page data include($path . 'contents/product/product.php'); include($path . 'contents/product/create.php'); // Load product page data include($path . 'contents/item/item.php'); include($path . 'contents/item/create.php'); function load_media_files() { wp_enqueue_media(); } add_action('admin_enqueue_scripts', 'load_media_files'); // Enqueue the custom _assets ?>