'string', 'single' => true, 'show_in_rest' => true, 'sanitize_callback' => 'sanitize_text_field', 'auth_callback' => static function() { return current_user_can( 'edit_posts' ); }, ) ); } } add_action( 'init', 'powerservices_register_seo_hero_meta' ); /** * Add the hero fields to the SEO post editor. */ function powerservices_add_seo_hero_meta_box() { add_meta_box( 'powerservices-seo-hero', 'Contenido del hero', 'powerservices_render_seo_hero_meta_box', 'seo', 'normal', 'high' ); } add_action( 'add_meta_boxes_seo', 'powerservices_add_seo_hero_meta_box' ); /** * Render the SEO hero fields. * * @param WP_Post $post Current post. */ function powerservices_render_seo_hero_meta_box( $post ) { $title = get_post_meta( $post->ID, '_powerservices_seo_hero_title', true ); $description = get_post_meta( $post->ID, '_powerservices_seo_hero_description', true ); wp_nonce_field( 'powerservices_save_seo_hero', 'powerservices_seo_hero_nonce' ); ?>

Estos textos se muestran únicamente en el hero de la plantilla SEO.