Inventory_Presser_Plugin::maybe_add_meta_query( array $meta_query, string $key, string $value, string $compare, string $type )
Filter callback that changes a query’s meta_query value if the meta_query does not already contain the provided $key.
Parameters Parameters
Return Return
(array) The modified $meta_query array
Source Source
File: inventory-presser.php
*/ public function mark_vehicles_for_sale_during_insertion( $post_ID, $post, $update ) { if ( $update ) { // Abort, we only want to affect insertions. return; } // Does the vehicle already have a term in the Availabilities taxonomy? $terms = wp_get_object_terms( $post_ID, 'availability' ); if ( ! empty( $terms ) && is_array( $terms ) ) { // Yes, abort. return; }
Expand full source codeCollapse full source codeView on Github