// Contributor Default Role / Kiri Vadivelu / 2026 function contributor_default_role( $default_role ) { return ‘contributor’; // Replace your choice } add_filter( ‘pre_option_default_role’, ‘contributor_default_role’ );Continue reading
/* * WPCode-Snippet “lokalstolz | Bildmasse ergaenzen” (Typ php, Location everywhere, Auto-Insert an, Prioritaet 10) * Oxygen 6 gibt an Bildern kein width und height aus. Lighthouse meldet dann “Image elements do not have explicit * width and height”, der…Continue reading
add_action( ‘admin_notices’, function () { $state = ( defined( ‘WP_DEBUG’ ) && WP_DEBUG ) ? ‘enabled’ : ‘disabled’; echo ‘ WP_DEBUG is ‘ . esc_html( $state ) . ‘. ‘; } );Continue reading
if ( ! is_admin() || wp_doing_ajax() ) { add_filter( ‘frm_validate_field_entry’, function ( $errors, $posted_field, $posted_value, $args ) { if ( ’email’ !== $posted_field->type || ! is_string( $posted_value ) ) { return $errors; } $error_key = ‘field’ . $args[‘id’]; if (…Continue reading
// Secure Admin Menu / Kiri Vadivelu / 2026 add_action( ‘admin_init’, ‘secure_admin_menu’ ); function secure_admin_menu() { // Replace 1 with the actual User ID of the owner $owner_id = 1; global $user_ID; // 1. If not owner, remove from sidebar…Continue reading
/* * WPCode-Snippet “lokalstolz | Kleine Stylesheets inline” (Typ php, Location everywhere, Auto-Insert an) * Zentral gepflegt in der WPCode-Bibliothek: Code in der Instanz nicht aendern. * Ziel: weniger render-blockierende Anfragen. Oxygen bindet viele winzige Stylesheets einzeln im Kopf ein…Continue reading
// Create Private Folder / Kiri Vadivelu / 2026 function create_private_folder() { $upload_dir = wp_upload_dir(); $private_path = trailingslashit( $upload_dir[‘basedir’] ) . ‘private-files’; // Update the status to debug log if ( ! is_dir( $private_path ) ) { $result = wp_mkdir_p(…Continue reading
/* * WPCode-Snippet “lokalstolz | Mauszeiger” (Typ php, Location everywhere, Auto-Insert an) * Zentral gepflegt in der WPCode-Bibliothek: Code in der Instanz nicht aendern. Farben, Groessen und * Selektoren je Projekt in der Option ls_mauszeiger (Array), siehe stack/wpcode-mauszeiger.md. * Eigener…Continue reading