Skip to content

Instantly share code, notes, and snippets.

View kontikidigital's full-sized avatar

Kontiki Digital kontikidigital

View GitHub Profile
@kontikidigital
kontikidigital / functions.php
Created February 1, 2024 19:21
ULTIMATE MEMBER Enable the HTML tags in options.
<?php
// ULTIMATE MEMBER Enable the HTML tags in options.
add_filter("um_builder_input_map","um_020422_change_options_sanitization");
function um_020422_change_options_sanitization( $arr ){
$arr['_options']['sanitize'] = 'wp_kses';
return $arr;
}
@kontikidigital
kontikidigital / functions.php
Created March 14, 2023 10:29
WooCommerce - Customize States for Spain
<?php
/**
* Customize States for Spain
*/
add_filter( 'woocommerce_states', 'tgt_woocommerce_states' );
function tgt_woocommerce_states( $states ) {
$states['ES'] = array(
'La Coruña' => __( 'La Coruña', 'woocommerce' ),
@kontikidigital
kontikidigital / import-if-syntax.md
Created February 17, 2023 09:25 — forked from trey8611/import-if-syntax.md
XPath IF statements

WP All Import - IF/ELSE statement examples

Here are some example WP All Import [IF] statements. The criteria for an IF statment is written in XPath 1.0 syntax and can use XPath functions. Although powerful, XPath syntax can be quite complex. In many cases it might be easier to use a PHP function as shown here.

The [ELSE]<something> part is optional

Number is equal to:

[IF({price[.=0]})]Zero[ELSE]Not Zero[ENDIF]

@kontikidigital
kontikidigital / functions.php
Created January 17, 2023 17:22
Generate post title and post slug from ACF single value fields
/**
* Generate post title and post slug from ACF single value fields
*
*/
add_action('acf/save_post', 'my_acf_save_post', 5);
function my_acf_save_post( $post_id ) {
$post_title = 'My default title';
$slug = 'my-default-slug';
@kontikidigital
kontikidigital / widget-product-categories.php
Created January 15, 2023 06:12 — forked from doubleedesign/widget-product-categories.php
Override the output of the WooCommerce product categories widget to be a Bootstrap accordion
<?php
/**
* Product Categories Widget
* Modifies the WooCommerce product categories widget to display as a Bootstrap accordion.
*
* @package WooCommerce/Widgets
* @version 2.3.0
*/
defined( 'ABSPATH' ) || exit;
@kontikidigital
kontikidigital / functions.php
Created July 2, 2020 17:50
WooCommerce Custom Tabs
<?php
/* Custom Tabs in WooCommerce */
add_filter( 'woocommerce_product_tabs', 'mt_custom_product_tabs' );
function mt_custom_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
$tabs['custom_tab_1'] = array(
@kontikidigital
kontikidigital / functions.php
Created May 20, 2020 07:59
Reduce the strength requirement for woocommerce registration password.
<?php
/*
* Reduce the strength requirement for woocommerce registration password.
* Strength Settings:
* 0 = Nothing = Anything
* 1 = Weak
* 2 = Medium
* 3 = Strong (default)
*/
@kontikidigital
kontikidigital / single.php
Created September 21, 2019 11:14
Snippets to customize Single Posts or Pages in Genesis
<?php
// Snippets to customize Single Posts in Genesis
// Hook this snippets in functions.php or in a template, You can use conditionals too.
// Hook Featured Image to Entry Header
add_action( 'genesis_entry_header', 'featured_post_image', 5 );
function featured_post_image() {
if ( !is_singular( array( 'post', 'page' ) )) return;
the_post_thumbnail('post-image');
}
@kontikidigital
kontikidigital / wpml-selector.css
Created January 21, 2019 16:42
WPML Short Language Code Selector
/* WPML Short ISO Selector */
li.wpml-ls-item {
list-style: none;
float: right;
margin: 3px;
color: #7a776e !important;
}
.wpml-ls-item > a {
color: #7a776e;
@kontikidigital
kontikidigital / functions.php
Last active May 29, 2018 14:59
WooCommerce: Remove connect to WooCommerce Message
<?php
// Do NOT include the opening php tag.
/* Remove connect to WooCommerce Message */
add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' );