This file contains hidden or 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 | |
/** | |
* Plugin Name: Filter WooCommerce Orders by Payment Method | |
* Plugin URI: http://skyverge.com/ | |
* Description: Filters WooCommerce orders by the payment method used :) | |
* Author: SkyVerge | |
* Author URI: http://www.skyverge.com/ | |
* Version: 1.0.0 | |
* Text Domain: wc-filter-orders-by-payment | |
* |
This file contains hidden or 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_rest_pre_insert_product_object', 'lpb_wc_disable_magage_stock_in_rest_api', 10, 2 ); | |
function lpb_wc_disable_magage_stock_in_rest_api ( $product, $request ) { | |
if ( 'yes' === get_option( 'woocommerce_manage_stock' ) && $product->is_type( 'variable' ) ) { | |
if ( isset( $request['manage_stock'] ) && $request['manage_stock'] ) { | |
unset( $request['manage_stock'] ); | |
$product->set_manage_stock( false ); | |
} | |
} |
This file contains hidden or 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
/* | |
* Validate the extra register fields. | |
* | |
* @param WP_Error $validation_errors Errors. | |
* @param string $username Current username. | |
* @param string $email Current email. | |
* | |
* @return WP_Error | |
*/ |