getThemeTemplatePath() ) . trailingslashit( $this->getThemeTemplateSubpath() ) . $templateName ] ); if ( ! $template ) { // Try paths, in order. foreach ( $this->paths as $path ) { $template = trailingslashit( $this->addPluginPath( $path ) ) . $templateName; if ( file_exists( $template ) ) { break; } } } return apply_filters( 'aioseo_locate_template', $template, $templateName ); } /** * Includes a template if the file exists. * * @param string $templateName The template path/name.php to be included. * @param null $data Data passed down to the template. * @return void */ public function getTemplate( $templateName, $data = null ) { $template = $this->locateTemplate( $templateName ); if ( ! empty( $template ) and file_exists( $template ) ) { include $template; } } /** * Add this plugin path when trying the paths. * * @since 4.0.17 * * @param string $path A path. * @return string A path with the plugin absolute path. */ protected function addPluginPath( $path ) { return trailingslashit( $this->pluginPath ) . $path; } /** * Returns the theme folder for templates. * * @since 4.0.17 * * @return string The theme folder for templates. */ public function getThemeTemplatePath() { return apply_filters( 'aioseo_template_path', $this->themeTemplatePath ); } /** * * Returns the theme subfolder for templates. * * @since 4.0.17 * * @return string The theme subfolder for templates. */ public function getThemeTemplateSubpath() { return apply_filters( 'aioseo_template_subpath', $this->themeTemplateSubpath ); } }