This file contains hidden or 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 | |
// 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 | |
This file contains hidden or 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
#!/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 |
This file contains hidden or 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
# Exportar todos los transients a CSV | |
wp transient list --format=json | jq -r 'map([.name, .expiration]) | map(join(",")) | .[]' > transients_export.csv |
This file contains hidden or 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
wp eval ' | |
$field_groups = acf_get_field_groups(["post_type" => "person"]); | |
foreach ($field_groups as $group) { | |
echo "Grupo: {$group["title"]} (key: {$group["key"]})\n"; | |
$fields = acf_get_fields($group["key"]); | |
if ($fields) { | |
foreach ($fields as $field) { | |
echo " - {$field["label"]} ({$field["name"]}) tipo: {$field["type"]}\n"; | |
} |
This file contains hidden or 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
wp eval ' | |
$posts = get_posts([ | |
"post_type" => "person", | |
"posts_per_page" => 500, | |
"fields" => "ids" | |
]); | |
$keys = []; | |
foreach ($posts as $id) { |
This file contains hidden or 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
wp term list persons_categories --format=table | |
wp term list persons_categories --format=csv > persons_categories.csv | |
wp term list persons_categories --format=json |
This file contains hidden or 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
wp eval ' | |
$post_id = 53972; // ID | |
$post_type = get_post_type($post_id); | |
$taxonomies = get_object_taxonomies($post_type); | |
foreach ($taxonomies as $tax) { | |
$terms = get_the_terms($post_id, $tax); | |
echo "Taxonomía: $tax\n"; | |
if (!empty($terms)) { | |
foreach ($terms as $term) { | |
echo "- {$term->name} (ID: {$term->term_id})\n"; |
This file contains hidden or 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
wp eval 'print_r( get_object_taxonomies("person") );' |
This file contains hidden or 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
expr $(tr -cd ',' < no-index.txt | wc -c) + 1 |
NewerOlder