View order-downloads.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 | |
/** | |
* | |
* This template has been modified to show the filename along with the title for each download | |
* Example: Download - filename.jpg | |
* | |
* Order Downloads. | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-downloads.php. | |
* |
View max-quantities-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 // only add this line if it's at the top of a new PHP file | |
add_filter( 'woocommerce_add_to_cart_validation', 'validate_add_to_cart_action', 10, 3 ); | |
function validate_add_to_cart_action( $valid, $product_id, $quantity ) { | |
// Set the product ID for the product you want to limit | |
$check_product_id = 121; | |
// We want to check two quantities, the current cart and how many you are currently adding. We're going to be adding them together into one variable called total_quantity. | |
$total_quantity = $quantity; | |
$maximum_quantity = 2; |
View disable-wp-search.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 ma_vip_unresolve_search() { | |
global $wp_query; | |
if ( $wp_query->is_search ) { | |
$wp_query->is_404 = true; | |
} | |
} | |
add_action( 'template_redirect', 'ma_vip_unresolve_search' ); |
View vip_jetpack_search_es_query_args.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 | |
add_filter( 'jetpack_search_es_query_args', function( $args, $query ) { | |
$args['date_range'] = array( | |
'field' => 'date', | |
'gte' => '2016-01-01', | |
'lte' => '2016-12-31', | |
); | |
return $args; | |
}, 10, 2 ); |
View jetpack-search-fuzzy.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 | |
// Fuzzy search | |
add_filter( 'jetpack_search_es_query_args', 'es_fuzzy_search', 10, 2); | |
function es_fuzzy_search( $es_query_args, $query ) { | |
$query = get_search_query(); | |
$es_query_args['query']['function_score']['query']['bool'] = array( | |
'must' => array( | |
array( | |
'multi_match' => array( |
View vipgo-remove-jp-stas.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 | |
// Disable the Stats Jetpack Module | |
add_filter( 'jetpack_active_modules', 'vipgo_override_jp_modules', 99, 9 ); | |
function vipgo_override_jp_modules( $modules ) { | |
$disabled_modules = array( | |
'stats', | |
); | |
foreach ( $disabled_modules as $module_slug ) { |
View launch.json
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for XDebug", | |
"type": "php", | |
"request": "launch", | |
"pathMappings": { "/var/www/wp-content": "${workspaceRoot}/" }, | |
"port": 9000 | |
}, |
View storefront-before-header-hook.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 | |
add_filter('storefront_before_header', function() { | |
echo 'Hello'; | |
}); |
View storefront-homepage-product-categories.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 | |
// Hooking into the storefront_product_categories_args hook | |
add_filter( 'storefront_product_categories_args', 'marce_filter_homepage_product_categories_storefront', 11 ); | |
// We're changing the values of limit, columns, and title for the Product Categories homepage section. | |
function marce_filter_homepage_product_categories_storefront( $args ) { | |
$args['limit'] = 1; | |
$args['columns'] = 4; | |
$args['title'] = 'Shop Categories'; |
View gallery-thumbnail.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 | |
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) { | |
return array( | |
'width' => 400, | |
'height' => 400, | |
'crop' => 1, | |
); | |
} ); |
NewerOlder