// REST API経由でCocoonのSEOメタデータを更新できるようにする add_action( 'rest_api_init', function () { // SEO タイトル register_meta( 'post', 'the_page_seo_title', array( 'type' => 'string', 'description' => 'Cocoon SEO Title', 'single' => true, 'show_in_rest' => true, ) ); // SEO ディスクリプション register_meta( 'post', 'the_page_meta_description', array( 'type' => 'string', 'description' => 'Cocoon SEO Description', 'single' => true, 'show_in_rest' => true, ) ); } ); // ============================================================ // Rinker (yyi-rinker) の rin_item を REST API に公開する // rin_item はデフォルトでは show_in_rest=false のため、 // Python から自動登録するためにここで有効化する。 // ============================================================ add_action( 'init', function () { // rin_item が登録されていれば REST API を有効化 if ( post_type_exists( 'rin_item' ) ) { global $wp_post_types; $wp_post_types['rin_item']->show_in_rest = true; $wp_post_types['rin_item']->rest_base = 'rin_item'; } }, 20 ); // Rinker の register_post_type (priority=10) より後に実行 add_action( 'rest_api_init', function () { $meta_keys = array( 'rin_rakuten_url' => 'Rinker 楽天URL', 'rin_rakuten_price' => 'Rinker 楽天価格', 'rin_amazon_url' => 'Rinker Amazon URL', 'rin_yahoo_url' => 'Rinker Yahoo URL', 'rin_img_url' => 'Rinker 商品画像URL', 'rin_etc_url' => 'Rinker その他URL', ); foreach ( $meta_keys as $key => $desc ) { register_post_meta( 'rin_item', $key, array( 'type' => 'string', 'description' => $desc, 'single' => true, 'show_in_rest' => true, ) ); } } ); http://kids-engineer-lab.com/sitemap-misc.xml 2026-02-25T16:18:34+00:00 http://kids-engineer-lab.com/post-sitemap.xml 2026-02-25T16:18:34+00:00