This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteRule ^(.*)$ https://sitioproduccion.com/$1 [QSA,L] | |
# Para entornos NGINX me ha funcionado poner lo siguiente en la configuración | |
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp|pdf)$ { | |
try_files $uri @image_fallback; | |
} | |
location @image_fallback { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: A faster load_textdomain | |
Version: 0.0.1 | |
Description: While we're wating for https://core.trac.wordpress.org/ticket/32052. | |
Author: Per Soderlind | |
Author URI: https://soderlind.no | |
Plugin URI: https://gist.github.com/soderlind/610a9b24dbf95a678c3e | |
License: GPL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Hide Pods Admin Menu if logged user is different that "username". | |
*/ | |
function css_hide_pods_noncl() { | |
global $current_user; | |
if ( 'username' !== $current_user->user_login ) { | |
echo '<style type="text/css">#toplevel_page_pods{display:none!important;}</style>'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Script for change WordPress live url to local url, | |
* local url to live url, http url to https url | |
* or any other url change in database. | |
* | |
* @author Carlos Longarela <carlos@longarela.eu> | |
* @link https://tabernawp.com/ | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('getOrderDetailById')) { | |
//to get full order details | |
function getOrderDetailById($id, $fields = null, $filter = array()) { | |
if (is_wp_error($id)) | |
return $id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cl_product_delete_meta_price( $product = null ) { | |
if ( ! is_object( $product ) ) { | |
global $product; | |
} | |
if ( ! is_a( $product, 'WC_Product' ) ) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "carloslongarela.id" is my Blockstack ID. https://onename.com/carloslongarela |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dng_nombre_archivo( $filename, $filename_raw ) { | |
$info = pathinfo( $filename ); | |
$nombre_arch = $info['filename']; | |
if ( ! empty( $info['extension'] ) ) { | |
$ext = $info['extension']; | |
} else { | |
$ext = ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Optimizar las imágenes con el programa de sistema jpegoptim | |
* | |
* @param array $array_imgs Array con los nombres de las fotos. | |
* @param string $ruta_fotos Ruta donde están las fotos. | |
* @param boolean $no_exec Si se ejecuta o sólo ver el resultado sin ejecutar. | |
* | |
* @return string|array Devuelve una cadena con el fallo o un array con los resultados. | |
*/ | |
function optimiza_img( $array_imgs, $ruta_fotos = '', $no_exec = true ) { |
NewerOlder