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
<? // no copiar esta línea | |
add_filter( 'the_content', 'dcms_list_data' ); | |
function dcms_list_data( $content ) { | |
$database_name = 'employees'; // nombre de la base de datos | |
$database_user = 'root'; | |
$database_pass = 'root'; | |
$database_server = 'localhost'; |
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
/* | |
Se requiere pasar un objeto vars_table, que contenga el selector de la tabla HTML y el placeholder, por ejemplo: | |
let vars_table = { | |
"select": "table.table-data", | |
"placeholder": "Buscar empleados" | |
} | |
*/ | |
(function( $ ) { |
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 // No copiar esta línea | |
function dcms_form_login_config() { | |
$redirect_login = get_home_url(); | |
$redirect_logout = get_home_url(); | |
if ( ! is_user_logged_in() ): | |
$args = array( | |
'echo' => false, | |
'redirect' => $redirect_login, |
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 // No copiar esta línea | |
// Register Custom Post Type | |
function contactos_post_type() { | |
$labels = array( | |
'name' => _x( 'Contactos', 'Post Type General Name', 'contactos_domain' ), | |
'singular_name' => _x( 'Contacto', 'Post Type Singular Name', 'contactos_domain' ), | |
'menu_name' => __( 'Contactos', 'contactos_domain' ), | |
'name_admin_bar' => __( 'Contactos', 'contactos_domain' ), |
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: Proceso por lotes recarga | |
Plugin URI: https://decodecms.com | |
Description: Plugin para demostración de proceso por lotes con recarga javascript | |
Version: 1.0 | |
Author: Jhon Marreros Guzmán | |
Author URI: https://decodecms.com | |
License: MIT | |
*/ |
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 // No copiar este línea | |
add_action('wp_footer', 'dcms_avoid_copy_paste'); | |
function dcms_avoid_copy_paste() { | |
if ( is_page('politica-privacidad') ): | |
?> | |
<script> | |
(function( $ ) { | |
// Evitar copiar pegar y menu contextual | |
$('body').bind('copy contextmenu',function(e) { |
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 // No copiar esta línea | |
add_action( 'woocommerce_after_shop_loop_item_title', 'dcms_categories_item_product', 10, 0 ); | |
function dcms_categories_item_product() { | |
if ( ! is_shop() ) return; | |
global $product; | |
$product_data = $product->get_data(); |
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 //No copiar esta línea | |
// Filtro para agregar contenido a una página de WordPress | |
add_filter('the_content', 'dcms_add_custom_content'); | |
// Agregamos contenido sólo a la página con el título "Contenido Vinos" | |
function dcms_add_custom_content($content){ | |
if ( ! is_page('contenido-vinos') ) return $content; |
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 //No copiar esta línea | |
add_action( 'woocommerce_thankyou', 'we_note_order_product' ); | |
function we_note_order_product( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
foreach ( $order->get_items() as $item ) { | |
$sku = $item->get_product()->get_sku(); |