get_document( $current_post_id ); if ( $document ) { // Show all taxonomies unset( $taxonomy_args['object_type'] ); } return $taxonomy_args; } /** * @access public * * @param $query_vars array * * @return array */ public function filter_query_control_args( $query_vars ) { $document = Plugin::elementor()->documents->get_doc_or_auto_save( get_the_ID() ); if ( $document && $document instanceof Theme_Document ) { $query_vars = $document->get_preview_as_query_args(); } return $query_vars; } /** * @access public */ public function switch_to_preview_query() { $current_post_id = get_the_ID(); $document = Plugin::elementor()->documents->get_doc_or_auto_save( $current_post_id ); if ( ! $document || ! $document instanceof Theme_Document ) { return; } $new_query_vars = $document->get_preview_as_query_args(); Plugin::elementor()->db->switch_to_query( $new_query_vars, true ); $document->after_preview_switch_to_query(); } /** * @access public */ public function restore_current_query() { Plugin::elementor()->db->restore_current_query(); } }