Basic-Kommentare vollständig deaktivieren

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Allow SVG Files Upload

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Disable Author Archives

// Return a 404 page for author pages if accessed directly. add_action( ‘template_redirect’, function () { if ( is_author() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } ); // Remove the author links. add_filter( ‘author_link’, ‘__return_empty_string’, 1000…Continue reading

Disable Automatic Updates Emails

// Disable auto-update emails. add_filter( ‘auto_core_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for plugins. add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for themes. add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ );Continue reading

My Account Modifications

/* * * MY-ACCOUNT MODIFICATIONS * */ // Remove downloads from menu add_filter ( ‘woocommerce_account_menu_items’, ‘silva_remove_my_account_links’ ); function silva_remove_my_account_links( $menu_links ){ unset( $menu_links[‘downloads’] ); // Disable Downloads return $menu_links; }Continue reading

Clean Up HTML – Post Content Editor

// Clean up HTML from blog posts function add_custom_cleanup_checkbox() { add_meta_box( ‘custom_cleanup_id’, // ID of the meta box ‘Custom Cleanup’, // Title of the meta box ‘custom_cleanup_checkbox_callback’, // Callback function ‘post’, // Post type ‘side’, // Context ‘high’ // Priority…Continue reading

Registration Surcharges

/* * REGISTRATION SURCHARGES * * Add a custom surcharge to your cart / checkout * change the $percentage to set the surcharge to a value to suit * * Loop through the cart items by category * Add $1…Continue reading