Skip to content

Instantly share code, notes, and snippets.

View jordan26's full-sized avatar

Jordan Charters jordan26

View GitHub Profile
@devinsays
devinsays / delete-completed-order-meta.php
Created December 28, 2022 18:18
Deletes meta data from completed orders created more than 90 days ago.
<?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';
@devinsays
devinsays / coupon-generator.php
Last active February 17, 2024 22:58
WP CLI script for generating coupon copies
<?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
*/
@chrismccoy
chrismccoy / restapi.txt
Last active March 30, 2024 08:17
WordPress REST API Resources
Disable REST Api without Plugins
https://rudrastyh.com/wordpress/disable-rest-api.html
Add featured image & alt text to WP REST API
https://allisontarr.com/2021/10/13/add-featured-image-alt-text-to-wp-rest-api/
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js