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
/** | |
* Trim zeros in price decimals | |
**/ | |
add_filter( 'woocommerce_price_trim_zeros', '__return_true' ); |
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
/** | |
* Change number of upsells output | |
*/ | |
add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 ); | |
function wc_change_number_related_products( $args ) { | |
$args['posts_per_page'] = 1; //change number of upsells here | |
$args['columns'] = 4; //change number of columns here | |
return $args; |
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
// Hide Admin Menu Editor | |
function hide_plugin() { | |
global $wp_list_table; | |
$hidearr = array('admin-menu-editor/menu-editor.php'); | |
$myplugins = $wp_list_table->items; | |
foreach ($myplugins as $key => $val) { | |
if (in_array($key,$hidearr)) { | |
unset($wp_list_table->items[$key]); | |
} | |
} |
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
define( 'WP_AUTO_UPDATE_CORE', false ); |
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
function my_myme_types($mime_types){ | |
$mime_types['svg'] = 'image/svg+xml'; //Adding svg extension | |
return $mime_types; | |
} | |
add_filter('upload_mimes', 'my_myme_types', 1, 1); |
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
/* Text before short description */ | |
add_filter( 'woocommerce_short_description', 'single_product_short_description', 10, 1 ); | |
function single_product_short_description( $post_excerpt ){ | |
global $product; | |
if ( is_single( $product->id ) ) | |
$post_excerpt = '<div class="product-message"><p>' . __( "Your text goes here.", "woocommerce" ) . '</p></div>' . $post_excerpt; | |
return $post_excerpt; | |
} |
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
add_action( 'woocommerce_before_checkout_form', 'action_before_checkout_form' ); | |
function action_before_checkout_form(){ | |
// HERE define the default payment gateway ID | |
$default_payment_gateway_id = 'woo-mercado-pago-basic'; | |
WC()->session->set('chosen_payment_method', $default_payment_gateway_id); | |
} |
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
add_filter( 'woocommerce_get_related_product_cat_terms', 'remove_related_product_categories', 10, 2 ); | |
function remove_related_product_categories( $terms_ids, $product_id ){ | |
return array(); | |
} |
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
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 ); | |
function spinner_url( $image_src, $form ) { | |
return "https://yourimage.gif"; | |
} |
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
add_action( 'wp_dashboard_setup', 'sh_dashboard_setup' ); | |
function sh_dashboard_setup() { | |
wp_add_dashboard_widget( 'sh_gf_dashboard', 'Formulario', 'sh_gf_dashboard' ); | |
} | |
function sh_gf_dashboard() { | |
gravity_form_enqueue_scripts( 2, true ); | |
gravity_form( 1, false, true, false, null, false ); | |
} |
NewerOlder