public function postTemplates( $templates, $theme, $post, $post_type ) {

		foreach ( $this->templates->all() as $template ) {

			if ( $template->forPostType( $post_type ) ) {

				$templates[ $template->filename() ] = esc_html( $template->label() );
			}
		}

		return $templates;
	}
public function postTemplates( $templates, $theme, $post, $post_type ) {

		foreach ( $this->templates->all() as $template ) {

			if ( $template->forPostType( $post_type ) ) {

				$templates[ $template->filename() ] = esc_html( $template->label() );
			}
		}

		return $templates;
	}
public function postTemplates ( $ templates , $ theme , $ post , $ post_type ) { foreach ( $ this -> templates -> all ( ) as $ template ) { if ( $ template -> forPostType ( $ post_type ) ) { $ templates [ $ template -> filename ( ) ] = esc_html ( $ template -> label ( ) ) ; } } return $ templates ; }
Filter used on `theme_templates` to add custom templates to the template
drop-down.

Note that this method is `public` because of WP's hook callback
system. See the implemented contract for publicly-available methods.

@since  5.0.0
@access public
@param  array   $templates
@param  object  $theme
@param  object  $post
@param  string  $post_type
@return array
Filter used on theme_templates to add custom templates to the template drop - down .