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.


Parameters Parameters

$atts

(array) (Required)


Top ↑

Return Return

(array)


Top ↑

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;
	}