Notas de la sección: Sin categoría

Tipos de archivos permitidos – Add allowed file type to WordPress multisite

The allowed file types list on a multisite is saved in a site option. To add a file type to the allowed uploads list, you can use this code:

add_filter('site_option_upload_filetypes', function($file_types) {

return rtrim($file_types) . ' ico ';

});

In this case, we are adding the “ico” file extension to allow for uploading of favicons to the media library.

Add unfiltered_html Capability to Admins or Editors in WordPress Multisite

Fuente: https://kellenmace.com/add-unfiltered_html-capability-to-admins-or-editors-in-wordpress-multisite/

<?php

/**
* Enable unfiltered_html capability for Editors.
*
* @param array $caps The user's capabilities.
* @param string $cap Capability name.
* @param int $user_id The user ID.
* @return array $caps The user's capabilities, with 'unfiltered_html' potentially added.
*/
function km_add_unfiltered_html_capability_to_editors( $caps, $cap, $user_id ) {

if ( 'unfiltered_html' === $cap && user_can( $user_id, 'editor' ) ) {

$caps = array( 'unfiltered_html' );

}

return $caps;
}
add_filter( 'map_meta_cap', 'km_add_unfiltered_html_capability_to_editors', 1, 3 );

PhpStorm Disable Search Help Menu Keybinding

Is maOS issue…

To diable OSX key mapping just follow below steps:

Click on Apple icon => System Preference => keyboard => shortcuts => App shortcuts=> uncheck show help menu

 

Source: https://intellij-support.jetbrains.com/hc/en-us/community/posts/207675825-Mac-OS-X-comment-block-command-slash?flash_digest=d0e03a17a258ff4b3bcf2c2a178a145d1b75bb3d

Solucionar problema de subida de imágenes en HostGator

Solution 5: Make GD Library Your Default Image Editor

Speaking of magic, did you know WordPress ships with two image editors? That’s right, WordPress uses either Imagick or the GD Library to process images. While they are both great, Imagick is notorious for exhausting the available memory and causing the HTTP error.

To circumvent this problem, you need to make GD Library your default editor. How? Just drop this code to your theme’s functions.php file:

  • function hs_image_editor_default_to_gd( $editors ) {
  • $gd_editor = ‘WP_Image_Editor_GD’;
  • $editors = array_diff( $editors, array( $gd_editor ) );
  • array_unshift( $editors, $gd_editor );
  • return $editors;
  • }
  • add_filter( ‘wp_image_editors’, ‘hs_image_editor_default_to_gd’ );<code></code>

Save your changes and try to upload the image again. If the HTTP error persists, revert the code change and try the next solution.

 

Fuente: https://www.hostinger.com/tutorials/http-error-when-uploading-images-to-wordpress

wordpress async-upload.php error hostgator

PHP & Sentora: Cambiar timeout y memory limit

Para cambiar los valores, debemos entrar al php.ini

En Debian/Ubuntu
# vi /etc/php5/apache2/php.ini

En CentOs
# /etc/php.ini

 

Y cambiar las dos variables a continuación

; Maximum execution time of each script, in seconds
 ; http://php.net/max-execution-time
 ; Note: This directive is hardcoded to 0 for the CLI SAPI
 max_execution_time = 360

; Maximum amount of memory a script may consume (128MB)
 ; http://php.net/memory-limit
 ;memory_limit = 512M
 memory_limit = 1G

 

Luego, recargamos el apache:

# service apache2 reload
A %d blogueros les gusta esto: