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 | |
namespace WooCommerce\Tests\New_Customer_Coupon; | |
/** | |
* Class New_Customer_Coupon. | |
* @package WooCommerce\Tests\New_Customer_Coupon | |
*/ | |
class New_Customer_Coupon extends \WC_Unit_Test_Case { |
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 | |
namespace DevPress\Frontend; | |
/** | |
* Class Performance | |
* | |
* @package DevPress\Performance | |
*/ | |
class Performance { |
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 | |
/** | |
* Generate coupon copies from an existing coupon. | |
* Replaces UNQCODE with a unique generated coupon code. | |
* | |
* For more information about this script: | |
* https://devpress.com/wp-cli-script-to-duplicate-woocommerce-coupons/ | |
* | |
* wp eval-file coupon-generator.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 | |
/** | |
* Delete postmeta for completed orders created more than X days ago. | |
* | |
* To delete meta on completed orders run: | |
* wp eval-file delete-completed-order-meta.php | |
*/ | |
// Transient allows the script to resume where it left off if interrupted. | |
$transient_name = 'last_processed_order'; |
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 | |
/** | |
* Exports product data. | |
* | |
* More about WP CLI scripts: | |
* https://wptheming.com/2021/05/wp-cli-scripts-and-woocommerce/ | |
* | |
* wp eval-file export-product-data.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 | |
/** | |
* Deletes customers without orders | |
* | |
* To run the script: | |
* wp eval-file delete-customers-without-orders.php | |
*/ | |
// Query for customers registered since this date. | |
$date_after = '2000-01-01'; |
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
SELECT | |
products.id, | |
products.post_title as title, | |
meta3.meta_value as sku, | |
meta2.meta_value as image_url | |
FROM | |
wp_qftw_posts products | |
LEFT JOIN | |
wp_qftw_postmeta meta1 | |
ON ( |
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 example_ajax_enqueue() { | |
// Enqueue javascript on the frontend. | |
wp_enqueue_script( | |
'example-ajax-script', | |
get_template_directory_uri() . '/js/simple-ajax-example.js', | |
array( 'jquery' ) | |
); |
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 | |
namespace Your_Namespace; | |
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; | |
/** | |
* Class Metabox. | |
* | |
* Example for how to add a metabox to the order screen that supports both HPOS and legacy order storage. | |
* More information: https://github.com/woocommerce/woocommerce/wiki/High-Performance-Order-Storage-Upgrade-Recipe-Book#audit-for-order-administration-screen-functions |
NewerOlder