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 | |
$actions = array( | |
'mvx_rest_api_request' => 'wcmp_rest_api_request', | |
'mvx_rest_insert_vendor_review' => 'wcmp_rest_insert_vendor_review', | |
'mvx_before_orders_list_query_bind' => 'before_wcmp_orders_list_query_bind', | |
'mvx_vendor_order_edit_status' => 'wcmp_vendor_order_edit_status', | |
'mvx_orders_list_do_handle_bulk_actions' => 'wcmp_orders_list_do_handle_bulk_actions', | |
'mvx_orders_list_do_handle_filter_actions' => 'wcmp_orders_list_do_handle_filter_actions', | |
'mvx_create_duplicate_product' => 'wcmp_create_duplicate_product', | |
'mvx_todo_done_pending_transaction' => 'wcmp_todo_done_pending_transaction', |
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( | |
'determine_current_user', | |
function( $user_id ) { | |
$expression = '/wordpress_logged_in/'; | |
$matches = preg_grep( $expression, array_keys( $_COOKIE ) ); | |
foreach ( $_COOKIE as $cookie_key => $cookie_value ) { |
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 code disables the Captcha verification when using WPGraphQL or WP REST API | |
* It fixes the "anr_error" issue. | |
* | |
* Put this code in your functions.php | |
*/ | |
add_action( | |
'rest_api_init', |
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 filter was added in file 'includes/tools/XML/XMLProductFeed.php' (LINE 298) | |
* It allows any user to add custom params to the feed generation. | |
*/ | |
add_filter('product_feed_params', function ( $params, $product, $parent_product ){ | |
if( $parent_product ){ | |
$product_id = $parent_product->get_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
<?php | |
/** | |
* Get all product terms and attributes | |
* | |
*/ | |
function get_all_product_terms() { | |
global $wpdb; | |
$taxonomies = $wpdb->get_results( "SELECT attribute_id, attribute_name, attribute_label FROM wp_woocommerce_attribute_taxonomies" ); |
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 | |
/** | |
* If virtual product has chained, it needs shipping. | |
* | |
* @param bool $is_virtual Default value. | |
* @param WC_Product $product The product object. | |
*/ | |
add_filter('woocommerce_is_virtual', function( $is_virtual, $product ){ | |
$chained_products = get_post_meta( $product->get_id(), '_chained_product_detail', true ); | |
$has_chained = ( is_array( $chained_products ) ) ? true : 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
<?php | |
/** | |
* COLOCAR NO FUNCTIONS.PHP DO TEMA | |
* OU EM ALGUM PLUGIN | |
*/ | |
/** | |
* Add shipping class field to method settings | |
* @param array $args Current method settings. | |
* @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
<?php | |
/** | |
* Sync order status to suborder WCMp | |
*/ | |
add_action( 'woocommerce_order_status_changed', 'wcmp_sync_suborder_status', 10, 3 ); | |
function wcmp_sync_suborder_status( $order_id, $old_status, $new_status ) { | |
$statuses_to_sync = array( | |
'processing', |
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 | |
/* | |
* CAUTION! | |
* This code will delete all generated thumbnails. Useful if you want to regenerate. | |
* Don't forget to regenerate thumbnails with wp-cli or any plugin. | |
*/ | |
add_action( 'init', 'remove_all_thumbnails' ); |
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('rank_math/redirection/pre_search', function($check, $uri, $full_uri){ | |
if( is_product() && strpos( $uri, 'shop' ) !== false && isset( $check['url_to'] ) && isset( $check['header_code'] ) ) | |
{ | |
$check = [ | |
'url_to' => 'shop/'.$check['url_to'], | |
'header_code' => $check['header_code'] | |
]; |
NewerOlder