@media only screen and (min-width: 769px) { .woocommerce-account .woocommerce-MyAccount-content, .woocommerce-account …
Open “edit” post link in a new tab
add_filter( 'post_row_actions', 'tab_row_actions', 10, 2 ); function tab_row_actions( $actions, $post ) { //echo ''; print_r( $actions ); …
Get order ID, customer shipping and billing information from WooCommerce database (MySQL query)
SELECT p.ID as order_id, p.post_date, max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value …
Strip “read more” anchor link from content so “read more” opens at the top of the page
// Filter to strip anchor link from the content (so "read more" goes to top of page, not anchor location). add_action('the_content', …
Get an array of variation IDs for a given product ID (all possible variations)
$product = wc_get_product( $product_id ); $variation_ids = $product->get_children(); …
Get an array of variation IDs for a given product ID (visible variations only)
$product = wc_get_product( $product_id ); $variations = $product->get_available_variations(); $variation_ids = wp_list_pluck( …
Disable author archives in WordPress
// Redirect author page requests. add_action( 'template_redirect', function() { global $wp_query; if ( isset( $_GET['author'] ) …
Extract data attributes from WooCommerce html tag
/** * Extraction utility to get attributes from an HTML tag. * * Example given defaults to WooCommerce "data-" attributes, but you …
Add additional scheduling options to WordPress
add_filter( 'cron_schedules', 'my_add_intervals' ); function my_add_intervals( $schedules ) { // Add a weekly …