protected function locate_template() : string {

		if ( isset( $this->template ) ) {
			return $this->template;
		}

		$templates = [];

		if ( ! empty( $this->name ) ) {
			$templates[] = "{$this->args['dir']}/{$this->slug}-{$this->name}.php";
		}

		$templates[] = "{$this->args['dir']}/{$this->slug}.php";

		$this->template = locate_template( $templates );

		if ( 0 !== validate_file( $this->template ) ) {
			$this->template = '';
		}
		return $this->template;

	}
protected function locate_template() : string {

		if ( isset( $this->template ) ) {
			return $this->template;
		}

		$templates = [];

		if ( ! empty( $this->name ) ) {
			$templates[] = "{$this->args['dir']}/{$this->slug}-{$this->name}.php";
		}

		$templates[] = "{$this->args['dir']}/{$this->slug}.php";

		$this->template = locate_template( $templates );

		if ( 0 !== validate_file( $this->template ) ) {
			$this->template = '';
		}
		return $this->template;

	}
protected function locate_template ( ) : string { if ( isset ( $ this -> template ) ) { return $ this -> template ; } $ templates = [ ] ; if ( ! empty ( $ this -> name ) ) { $ templates [ ] = "{$this->args['dir']}/{$this->slug}-{$this->name}.php" ; } $ templates [ ] = "{$this->args['dir']}/{$this->slug}.php" ; $ this -> template = locate_template ( $ templates ) ; if ( 0 !== validate_file ( $ this -> template ) ) { $ this -> template = '' ; } return $ this -> template ; }
Locate the template part file according to the slug and name.

@return string The template part file name. Empty string if none is found.
Locate the template part file according to the slug and name .