Skip to content

Instantly share code, notes, and snippets.

View dompl's full-sized avatar

Dom dompl

  • Red Frog Studio
  • United Kingdom
View GitHub Profile
wp user list --field=ID --role=customer | xargs wp user delete --yes
wp post list --field=ID --post_type=shop_order --posts_per_page=2000 | xargs wp post delete --force
wp post list --field=ID --post_type=products --posts_per_page=2000 | xargs wp post delete --force
wp post list --field=ID --post_type=posts --posts_per_page=2000 | xargs wp post delete --force
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
<?php
$args = array(
'label' => '', // Text in Label
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '', // if empty, retrieved from post meta where id is the meta_key
'id' => '', // required
'name' => '', //name will set from id if empty
@dompl
dompl / wp-query-ref.php
Last active August 31, 2021 11:31 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
$args = array(