is_edited_with_builder( $post_id ) === false ) { return; } $this->set_page_template( $post_id ); } /** * Set page layout. * * @param string $post_id the post id. */ private function set_page_template( $post_id ) { global $post; if ( isset( $post ) && ( is_admin() || is_singular() ) && empty( $post->post_content ) ) { update_post_meta( $post_id, '_wp_page_template', 'page-templates/template-pagebuilder-full-width.php' ); } } }