Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Inventory_Presser_Shortcode_Archive::clean_attributes_for_query( array $atts )
Removes shortcode attributes from the attributes array that are not also query parameters for a posts query.
On This Page
Parameters Parameters
- $atts
-
(array) (Required)
Return Return
(array)
Source Source
File: includes/shortcode/class-shortcode-archive.php
private function clean_attributes_for_query( $atts ) { unset( $atts['show_titles'] ); // Turn the location attribute into a tax_query. if ( ! empty( $atts['location'] ) ) { $atts['tax_query'] = array( array( 'taxonomy' => 'location', 'field' => 'slug', 'terms' => $atts['location'], ), ); } return $atts; }
Expand full source codeCollapse full source codeView on Github