Disable editor in Posts & Pages

function disable_editor_for_selected_post_types() { $disabled_post_types = array(‘post’, ‘page’); // Liste der zu deaktivierenden Post-Typen foreach ($disabled_post_types as $post_type) { remove_post_type_support($post_type, ‘editor’); } } add_action(‘init’, ‘disable_editor_for_selected_post_types’);Continue reading

Remove Google Font

// Entfernt Google Fonts von WordPress und Breakdance function remove_google_fonts() { global $wp_styles; // Durch alle registrierten Styles iterieren und Google Fonts entfernen foreach ($wp_styles->registered as $handle => $style) { if (strpos($style->src, ‘fonts.googleapis.com’) !== false) { wp_dequeue_style($handle); wp_deregister_style($handle); } }…Continue reading

Woo Products Limit For Admin

add_action(‘admin_init’, ‘restrict_product_creation’); function restrict_product_creation() { $product_count = wp_count_posts(‘product’)->publish; if ($product_count >= 10) { add_action(‘admin_footer’, function() { echo ‘ ‘; }); add_filter(‘wp_insert_post_data’, function($data, $postarr) { if ($data[‘post_type’] === ‘product’ && $data[‘post_status’] !== ‘trash’) { wp_die(‘You have reached the maximum limit of…Continue reading

Bulk add shipping zone methods

function bulk_update_shipping_zones_vayots_dzor() { global $wpdb; // Define the shipping zones and their corresponding state codes $zones = array( ‘Ագարակաձոր’ => [‘code’ => ‘AG1’, ‘price’ => 9600], ‘Ազատեկ’ => [‘code’ => ‘AR2’, ‘price’ => 11600], ‘Ախտա’ => [‘code’ => ‘AI3’, ‘price’…Continue reading

Payment plan Calculator CSS style

.payment-plans { margin-top: 20px; padding: 15px; background-color: #fff; border: 1px solid #ddd; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; } .payment-plans h3 { font-size: 20px; font-weight: bold; margin-bottom: 10px; color: #333; width: 100%; text-align: center; } .payment-plan…Continue reading

Payment Plan Calculator

// Register a shortcode to display payment plans with minimalistic design add_shortcode(‘pedro_payment_plans’, ‘pedro_display_payment_plans’); function pedro_display_payment_plans() { // Get the global product object global $product; // Ensure $product is valid if (!$product || !is_a($product, ‘WC_Product’)) { return ”; // Return nothing…Continue reading