diff --git a/includes/manager/class-content-model-loader.php b/includes/manager/class-content-model-loader.php index ef3f2cf..7698e82 100644 --- a/includes/manager/class-content-model-loader.php +++ b/includes/manager/class-content-model-loader.php @@ -63,10 +63,9 @@ private function __construct() { add_action( 'the_post', array( $this, 'map_template_to_content_model_editor_signature' ) ); /** - * Update placeholder prompts to be more suitable for creating a new model. + * Update title placeholder to be more suitable for creating a new model. */ add_filter( 'enter_title_here', array( $this, 'set_title_placeholder' ), 10, 2 ); - add_filter( 'default_content', array( $this, 'set_content_placeholder' ), 10, 2 ); } /** @@ -111,6 +110,12 @@ private function register_post_type() { 'show_in_menu' => true, 'show_in_rest' => true, 'supports' => array( 'title', 'editor', 'custom-fields' ), + 'template' => array( + array( + 'core/paragraph', + array( 'placeholder' => __( 'Start building your model' ) ), + ), + ), ) ); @@ -329,22 +334,4 @@ public function set_title_placeholder( $title, $post ) { } return $title; } - - /** - * Sets the content placeholder for the Content Model post type. - * - * @param string $content The default content. - * @param WP_Post $post The current post object. - * @return string The modified default content. - */ - public function set_content_placeholder( $content, $post ) { - if ( Content_Model_Manager::POST_TYPE_NAME === $post->post_type ) { - $placeholder = __( 'Start building your model' ); - return sprintf( - '

', - esc_attr( $placeholder ) - ); - } - return $content; - } }