View custom-filters-woocommerce.php
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 | |
// Set query vars | |
add_filter('query_vars', 'dcms_add_query_vars'); | |
function dcms_add_query_vars($query_vars) { | |
$query_vars[] = "dcms-stock"; | |
$query_vars[] = "dcms-brand"; | |
return $query_vars; | |
} |
View sessions_wordpress.php
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( 'init', 'dcms_session_start' ); | |
function dcms_session_start() { | |
if ( ! session_id() ) { | |
session_start(); // Iniciamos la sesion | |
} | |
} | |
add_action( 'wpcf7_submit', 'dcms_action_wpcf7_submit', 10, 2 ); |
View move-variation-price.php
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_add_script_footer' ); | |
function dcms_add_script_footer() { | |
if ( ! is_product() ) return; | |
?> | |
<script> | |
jQuery(function ($) { | |
$('.variations_form').on('woocommerce_variation_has_changed', function () { |
View add-blog-slug-posts-wordpress.php
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('generate_rewrite_rules', 'dcms_posts_add_rewrite_rules'); | |
function dcms_posts_add_rewrite_rules( $wp_rewrite ){ | |
$slug = "blog"; | |
$new_rules = [ | |
$slug.'/page/([0-9]{1,})/?$' => 'index.php?post_type=post&paged='. $wp_rewrite->preg_index(1), | |
$slug.'/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1), | |
]; | |
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules; |
View search-custom-table-with-shortcode.php
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 | |
// ShortCode | |
add_action( 'init', 'dcms_frm_shortcode' ); | |
function dcms_frm_shortcode(){ | |
add_shortcode('search-form', 'dcms_search_form'); | |
} | |
function dcms_search_form( $atts , $content ){ | |
global $wpdb; |
View save_search_wordpress.php
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 dcms_count_text_search( $query_object ) { | |
if( $query_object->is_search() ) { | |
global $wpdb; | |
$table = $wpdb->prefix . 'text_search'; //Nombre de la tabla | |
$col_search = 'search'; //unique | |
$col_count = 'count'; |
View custom-table-search-pagination.php
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 //don't copy this line | |
// Show custom table data in a WordPress specific page | |
// includes pagination and search | |
add_filter( 'the_content', 'dcms_list_data' ); | |
function dcms_list_data( $content ) { | |
$slug_page = 'empleados'; //slug page where show data | |
$table_name = 'employee'; // custom table name |
View custom-text-field-produt-woocommerce.php
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 | |
// show custom field in product page | |
function dcms_display_field() { | |
// Optional validation for specif category | |
// global $product; | |
// $categories = $product->get_category_ids(); | |
// if ( ! in_array(34, $categories )) return; |
View particles-js.php
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 | |
// The shortcode only works in WordPress front page | |
// Shortcode Creation | |
add_action( 'init', 'dcms_add_shortcode' ); | |
function dcms_add_shortcode(){ | |
add_shortcode('particles-background', 'dcms_particles_background'); | |
} |
View tabs.php
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 | |
// Change template tabs.php estructure | |
// Copy this file to: /wp-content/TU_THEME/woocommerce/single-product/tabs/tabs.php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
$product_tabs = apply_filters( 'woocommerce_product_tabs', array() ); |
NewerOlder