Coded Options Page

// 1️⃣ Admin Menüpunkt für die globale Einstellungsseite hinzufügen function my_custom_global_settings() { add_menu_page( ‘Globale Einstellungen’, // Seitentitel ‘Globale Daten’, // Menüpunkt-Name ‘manage_options’, // Berechtigung ‘global-settings’, // Slug ‘my_global_settings_page’, // Callback-Funktion ‘dashicons-admin-generic’, // Icon 80 // Position im Menü ); }…Continue reading

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

om.Campaign.afterShow (copy)

document.addEventListener(‘om.Campaign.afterShow’, function(event) { if (event.detail.Campaign.id == ‘zjd3hxxogbfvmy2iz0rp’) // your slug { var campaignID = ‘om-‘+ event.detail.Campaign.id; var campaignHeight = document.getElementById(campaignID).offsetHeight; var fixedElement = document.getElementById(‘top’); //give ID for your fixed element OR document.querySelector(‘.yourClassName.yourSecondClassName’); fixedElement.style.top = campaignHeight + ‘px’; } }); document.addEventListener(‘om.Campaign.close’,…Continue reading

Remove “mail.readwrite” Scope for the Outlook Mailer

/* Removing “mail.readwrite” for the Outlook Mailer * * Original doc: https://wpmailsmtp.com/docs/removing-mail-readwrite-scope-for-the-outlook-mailer/ */ add_filter( ‘wp_mail_smtp_pro_providers_outlook_auth_get_scopes’, function ( $scopes ) { foreach ( $scopes as $key => $scope ) { if ( $scope === ‘https://graph.microsoft.com/mail.readwrite’ ) { unset( $scopes[ $key ]…Continue reading