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 the default role to employer after checkout. | |
* | |
* @param int $order_id | |
* @return void | |
*/ | |
function marce_set_employer_role_after_checkout( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
$user = $order->get_user(); |
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_action( 'resume_manager_resume_submitted', 'wpjmres_final_redirect', 99); | |
function wpjmres_final_redirect(){ | |
if ( is_admin() ) { | |
return; | |
} | |
wp_redirect('https://wpjm.local/test/'); | |
exit(); | |
} |
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. | |
* |
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; |
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' ); |
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 ); |
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( |
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 ) { |
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 | |
}, |
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'; | |
}); |
NewerOlder