init.php
public function maybe_callback( $query, $post_args ) {
		$cmb   = isset( $post_args['cmb_id'] ) ? $post_args['cmb_id'] : '';
		$group = isset( $post_args['group_id'] ) ? $post_args['group_id'] : '';
		$field = isset( $post_args['field_id'] ) ? $post_args['field_id'] : '';

		$cmb = cmb2_get_metabox( $cmb );
		if ( $cmb && $group ) {
			$group = $cmb->get_field( $group );
		}

		if ( $cmb && $field ) {
			$group = $group ? $group : null;
			$field = $cmb->get_field( $field, $group );
		}

		if ( $field && ( $cb = $field->maybe_callback( 'attached_posts_search_query_cb' ) ) ) {
			call_user_func( $cb, $query, $field, $this );
		}
	}
public function maybe_callback( $query, $post_args ) {
		$cmb   = isset( $post_args['cmb_id'] ) ? $post_args['cmb_id'] : '';
		$group = isset( $post_args['group_id'] ) ? $post_args['group_id'] : '';
		$field = isset( $post_args['field_id'] ) ? $post_args['field_id'] : '';

		$cmb = cmb2_get_metabox( $cmb );
		if ( $cmb && $group ) {
			$group = $cmb->get_field( $group );
		}

		if ( $cmb && $field ) {
			$group = $group ? $group : null;
			$field = $cmb->get_field( $field, $group );
		}

		if ( $field && ( $cb = $field->maybe_callback( 'attached_posts_search_query_cb' ) ) ) {
			call_user_func( $cb, $query, $field, $this );
		}
	}
public function maybe_callback ( $ query , $ post_args ) { $ cmb = isset ( $ post_args [ 'cmb_id' ] ) ? $ post_args [ 'cmb_id' ] : '' ; $ group = isset ( $ post_args [ 'group_id' ] ) ? $ post_args [ 'group_id' ] : '' ; $ field = isset ( $ post_args [ 'field_id' ] ) ? $ post_args [ 'field_id' ] : '' ; $ cmb = cmb2_get_metabox ( $ cmb ) ; if ( $ cmb && $ group ) { $ group = $ cmb -> get_field ( $ group ) ; } if ( $ cmb && $ field ) { $ group = $ group ? $ group : null ; $ field = $ cmb -> get_field ( $ field , $ group ) ; } if ( $ field && ( $ cb = $ field -> maybe_callback ( 'attached_posts_search_query_cb' ) ) ) { call_user_func ( $ cb , $ query , $ field , $ this ) ; } }
If field has a 'attached_posts_search_query_cb', run the callback.

@since  1.2.4

@param  WP_Query $query     WP_Query instance during the pre_get_posts hook.
@param  array    $post_args The $_POST array.

@return void
If field has a attached_posts_search_query_cb run the callback .