Allow SVG Files Upload (copy)

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

Allow SVG Files Upload (copy)

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

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

FC – Mejoras en el procesamiento de archivos

// 1) Renombrar + sanitizar SOLO cuando se sube un archivo (Media, ACF, REST, etc.) add_filter( ‘wp_handle_upload_prefilter’, ‘fc_upload_rename_prefilter’, 10 ); add_filter( ‘wp_handle_sideload_prefilter’, ‘fc_upload_rename_prefilter’, 10 ); function fc_upload_rename_prefilter( $file ) { $info = pathinfo( $file[‘name’] ); $ext = ! empty( $info[‘extension’]…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

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

FC – Mejoras en el procesamiento de imágenes

//* Evitar que WP cree tamaños de imagen adicionales add_action(‘intermediate_image_sizes_advanced’, function ($sizes) { unset($sizes[‘1536×1536’]); // desactivar tamaño medio-grande x2 unset($sizes[‘2048×2048’]); // desactivar tamaño grande x2 return $sizes; }); //* Evitar que se creen los tamaños escalados add_filter(‘big_image_size_threshold’, ‘__return_false’, PHP_INT_MAX-20); //*…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

Allow SVG Files Upload (copy)

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