$args = array(
'post_type' => 'product'
);
$saleProducts = wc_get_product_ids_on_sale();
$args = array(
'post_type' => 'product',
'post__in' => array_merge(array(0), $saleProducts)
);
$query = new WP_Query($args);
wp_update_user(array('ID' => 123, 'role' => 'editor'));
function remove_parent_category_from_url( $args ) {
$args['rewrite']['hierarchical'] = false;
return $args;
}
add_filter( 'woocommerce_taxonomy_args_product_cat', 'remove_parent_category_from_url' );
add_image_size('...
wp_update_post(array(['ID'] => $post->ID));