関数
WishlistPage::handleWishlistPageTemplateLoad( bool $flag )
現在のページがお気に入りリストページである場合、テーマのwishlist.phpが存在していればそれを読み込み、存在しなければデフォルトのお気に入りリストページのHTMLを読み込み、終了する
パラメータ パラメータ
- $flag
(bool) (必須)
falseファイル: src/Views/WishlistPage/WishlistPage.php
public function handleWishlistPageTemplateLoad($flag) {
if (!Utils::isWishlistPage($_SERVER['REQUEST_URI'])) {
return $flag;
}
$parent_path = get_template_directory();
$child_path = get_stylesheet_directory();
/**
* Filters the absolute path to the `wishlist.php` for the **parent theme**
*
* @important
* @param string $parent_path Default: `get_template_directory() . '/wishlist.php'`
*/
$parent_file = apply_filters('wcexwl_filter_wishlist_page_parent_path', $parent_path . '/wishlist.php');
/**
* Filters the absolute path to the `wishlist.php` for the **child theme**
*
* @important
* @param string $child_path Default: `get_stylesheet_directory() . '/wishlist.php'`
*/
$child_file = apply_filters('wcexwl_filter_wishlist_page_child_path', $child_path . '/wishlist.php');
if (!file_exists($child_file) && !file_exists($parent_file)) {
include(WCEXWL_PLUGIN_DIR . '/src/templates/wishlist.php');
exit;
}
return $flag;
}