Skip to content

Instantly share code, notes, and snippets.

View loorlab's full-sized avatar
💻
💥👩‍🚀👨‍🚀💥

LOOR Lab loorlab

💻
💥👩‍🚀👨‍🚀💥
View GitHub Profile
@loorlab
loorlab / disable_block_editor_homepage_WP.php
Created March 21, 2026 04:37
Disable the Block Editor (Gutenberg) ONLY on the Home Page - WordPress
<?php
/**
* Desactivar el Editor de Bloques (Gutenberg) SOLO en la Página de Inicio
* functions.php
*/
add_filter('use_block_editor_for_post', 'disable_gutenberg_for_homepage', 10, 2);
function disable_gutenberg_for_homepage($is_use_block_editor, $post) {
// Obtenemos el ID de la página configurada como "Inicio" en los ajustes de lectura
@loorlab
loorlab / open_multiple_links_admin_WP.js
Created December 15, 2025 05:14
Open multiple link from admin WordPress - console JS
@loorlab
loorlab / restore-vscode.ps1
Last active September 2, 2025 01:21
Restore Backup VS Code - Extensions + Settings - WIN
# === RESTAURAR VS CODE ===
$ErrorActionPreference = 'Stop'
# Ruta de backup
$backupPath = Join-Path $env:USERPROFILE 'Documents\VSCode_Backup'
$extPath = Join-Path $env:USERPROFILE '.vscode\extensions'
$settingsPath = Join-Path $env:APPDATA 'Code\User'
Write-Host ('Restaurando desde: ' + $backupPath)
@loorlab
loorlab / backup-vscode.ps1
Created September 2, 2025 01:17
Backup VS Code - Extensions + Settings - WIN
# backup-vscode.ps1 - Back up VS Code extensions and settings on Windows (ASCII-only)
$ErrorActionPreference = 'Stop'
# Paths
$backupPath = Join-Path $env:USERPROFILE 'Documents\VSCode_Backup'
$extPath = Join-Path $env:USERPROFILE '.vscode\extensions'
$settingsPath = Join-Path $env:APPDATA 'Code\User'
Write-Host ('Creando carpeta de backup en: ' + $backupPath)
@loorlab
loorlab / simple_modal_WP.php
Created August 20, 2025 18:05
Simple Modal WordPress
<?php
// functions.php
add_action('wp_footer', function() { ?>
<div id="simple-modal" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); z-index:9999; justify-content:center; align-items:center;">
<div style="background:#fff; padding:20px; border-radius:10px; max-width:400px; text-align:center; position:relative;">
<span id="close-modal" style="position:absolute; top:10px; right:15px; cursor:pointer; font-size:20px;">&times;</span>
<h2>Hola 👋</h2>
<p>Este es un modal simple en WordPress.</p>
</div>
</div>
@loorlab
loorlab / query_mysql_total_posts_categories_exclude_pages_cpt_WP.sql
Created August 15, 2025 12:58
Query - MySQL - WordPress | Display all Posts with Categories exclude pages and other content type
SELECT
p.ID,
p.post_title,
p.post_status,
CONCAT(u.option_value, '/', p.post_name, '/') AS permalink,
GROUP_CONCAT(t.name ORDER BY t.name SEPARATOR ', ') AS categories
FROM
wp_posts p
JOIN
wp_options u
@loorlab
loorlab / disable_WooCommerce_WP.php
Last active June 29, 2025 01:43
Disable WooCommerce - Exclude Pages
<?php
// functions.php - Plugin
// Disable WooCommerce
function dw_conditional_woocommerce_assets() {
if (function_exists('is_woocommerce')) {
// Verifica si estamos en una página WooCommerce esencial
$is_woocommerce_page = is_woocommerce() || is_cart() || is_checkout() || is_account_page();
// Handles específicos a remover si no estamos en una página WooCommerce
@loorlab
loorlab / report_transients_WP.bash
Created May 18, 2025 05:03
Report Transients Bash WP .sh
#!/bin/bash
# Crear nombre de archivo con fecha actual
FECHA=$(date +"%Y-%m-%d_%H-%M")
ARCHIVO="transients_report_$FECHA.csv"
# Crear encabezado del CSV
echo "Nombre,Valor,Expira_en" > $ARCHIVO
# Obtener lista de transients en formato json
@loorlab
loorlab / transients_CSV_WP_CLI.bash
Created May 18, 2025 05:01
Transients to CSV - WP CLI
# Exportar todos los transients a CSV
wp transient list --format=json | jq -r 'map([.name, .expiration]) | map(join(",")) | .[]' > transients_export.csv
@loorlab
loorlab / ACF_fields_related_WP_CLI.bash
Created May 17, 2025 19:04
ACF fields related to each other - WP CLI