SVG upload for WP Admin only

/** * Enable SVG uploads for Administrators only */ function enable_svg_uploads_for_admins($mime_types) { if (current_user_can(‘manage_options’)) { $mime_types[‘svg’] = ‘image/svg+xml’; $mime_types[‘svgz’] = ‘image/svg+xml’; } return $mime_types; } add_filter(‘upload_mimes’, ‘enable_svg_uploads_for_admins’); /** * Bypass secondary file-type check for SVG uploads by admins */ function…Continue reading

lokalstolz | Bildmaße ergänzen

/* * 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

test

add_action( ‘admin_notices’, function () { $state = ( defined( ‘WP_DEBUG’ ) && WP_DEBUG ) ? ‘enabled’ : ‘disabled’; echo ‘ WP_DEBUG is ‘ . esc_html( $state ) . ‘. ‘; } );Continue reading

FC – [*] – URL de acceso propia

/** * FC – [*] – URL de acceso propia (snippet de WPCode, tipo PHP, «Run Everywhere»). * * Cambia la dirección de acceso a WordPress, como WPS Hide Login: * * – El acceso pasa a https://la-web/{slug}/. El slug…Continue reading

FC – [*] – Endurecimiento básico

/** * FC – [*] – Endurecimiento básico (snippet de WPCode, tipo PHP, «Run Everywhere»). * * Quita de la web lo que da pistas a quien busca atacarla, sin cambiar nada * de lo que ven los visitantes: *…Continue reading

File Upload Type

// 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