memo: 要検討 if ( defined( 'ARKHE_EX_PARTS_PATH' ) ) { $include_path = ARKHE_EX_PARTS_PATH . '/template-parts/' . $path . '.php'; if ( file_exists( $include_path ) ) return $include_path; } // 最後に、親テーマを探す $include_path = ARKHE_THEME_PATH . '/template-parts/' . $path . '.php'; if ( file_exists( $include_path ) ) return $include_path; // 見つからなかった時 return ''; } /** * テンプレート読み込み実行部分 * Toolkitからキャッシュされるのはここ */ public static function the_parts_content( $path_key = '', $include_path = '', $args = null ) { // フィルターフックがあれば通す $filter_name = 'arkhe_parts_' . $path_key; if ( has_filter( $filter_name ) ) { ob_start(); include $include_path; $parts_content = ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo apply_filters( $filter_name, $parts_content, $args ); } else { // 普通にファイルを読み込むだけ include $include_path; } } }