この関数の適用範囲(スコープ)はプライベートのため、プラグインやテーマからはご利用できません。
関数
Activation::makeWishlistPage()
戻り値 戻り値
ファイル: src/Activation.php
private function makeWishlistPage() {
global $wpdb;
$datetime = get_date_from_gmt(gmdate('Y-m-d H:i:s', time()));
$datetime_gmt = gmdate('Y-m-d H:i:s', time());
$query = $wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE post_name = %s", WCEXWL_PAGE_SLUG);
$pageid = $wpdb->get_var($query);
if ($pageid === null) {
$query = $wpdb->prepare(
"INSERT INTO $wpdb->posts
(post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status,
comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified,
post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type,
post_mime_type, comment_count)
VALUES (%d, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s,
%s, %d, %s, %d, %s, %s, %d)",
1,
$datetime,
$datetime_gmt,
'',
__('Wishlist', 'wcexwl'),
'',
'publish',
'closed',
'closed',
'',
WCEXWL_PAGE_SLUG,
'',
'',
$datetime,
$datetime_gmt,
'',
0,
'',
0,
'page',
'',
0
);
$wpdb->query($query);
$pageid = $wpdb->insert_id;
if ($pageid !== null) {
update_post_meta($pageid, '_wp_page_template', 'wishlist.php');
}
}
update_option('wcex_wishlist_post_id', $pageid);
}