Skip to content

Instantly share code, notes, and snippets.

View CarlosLongarela's full-sized avatar
🏠
WordPress Codeable Expert

Carlos Longarela CarlosLongarela

🏠
WordPress Codeable Expert
View GitHub Profile
@CarlosLongarela
CarlosLongarela / uploads_produccion.txt
Created July 19, 2022 22:06 — forked from fgrweb/uploads_produccion.txt
Código en .htaccess para que lea los archivos de medios del sitio en producción
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 {
<?php
/**
* WordPress menu cache.
*
* @package BJ\Menu
* @author bjornjohansen
* @version 0.1.0
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License version 2 (GPLv2)
*/
@CarlosLongarela
CarlosLongarela / a_faster_load_textdomain.php
Last active November 23, 2022 00:27 — forked from soderlind/a_faster_load_textdomain.php
A faster load_textdomain for WordPress
<?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
@CarlosLongarela
CarlosLongarela / get-order-detail-by-order-id.php
Created September 5, 2018 18:36 — forked from web-hat/get-order-detail-by-order-id.php
Works with WooCommerce 3.x or above
<?php
if (!function_exists('getOrderDetailById')) {
//to get full order details
function getOrderDetailById($id, $fields = null, $filter = array()) {
if (is_wp_error($id))
return $id;