// File Upload Type / Kiri Vadivelu / 2026 add_filter( ‘upload_mimes’, function( $mimes ) { return array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘png’ => ‘image/png’, ‘ico’ => ‘image/x-icon’, ‘webp’ => ‘image/webp’, ‘pdf’ => ‘application/pdf’, // ‘mp3’ => ‘audio/mpeg’, // ‘mp4|m4v’ => ‘video/mp4’,…Continue reading
// Max Upload Size / Kiri Vadivelu / 2026 function max_upload_size( $file ) { $max = 9 * 1024 * 1024; // 9 MB if ( $file[‘size’] > $max ) { $file[‘error’] = ‘File exceeds the 9 MB maximum upload…Continue reading
// Image Max Pixel / Kiri Vadivelu / 2026 add_filter(‘wp_handle_upload_prefilter’, ‘image_max_pixel’); function image_max_pixel($file) { $image = getimagesize($file[‘tmp_name’]); if ($image[0] > 4000 || $image[1] > 4000) { $file[‘error’] = ‘Image too large (max 4000×4000).’; } return $file; }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
add_filter(‘gutenberg_can_edit_post’, ‘__return_false’, 5); add_filter(‘use_block_editor_for_post’, ‘__return_false’, 5);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
/* * WPCode-Snippet “lokalstolz | Grundkorrekturen” (Typ php, Location everywhere, Auto-Insert an) * Vorlage aus der web-wissensbasis (stack/quelltext-hygiene.md, oxygen/13-wordpress-grundeinstellungen.md). * Titel in WPCode und Bibliothek genau so. Fuer jede Oxygen-6-Instanz (Dev und Studio-WordPress). * Zentral gepflegt in der WPCode-Bibliothek: Code…Continue reading
/* * WPCode-Snippet “lokalstolz | Gravity Forms Pflichtfelder (statisch)” (Typ php, Location everywhere, Auto-Insert an) * Titel in WPCode und Bibliothek genau so. Fuer jedes Projekt mit Gravity Forms auf Static Studio (Dev und Studio-WordPress). * Entstanden 16.10.2026. Die Studio-Validierung…Continue reading