public function migratePartContentToEditor() {

		/** @var $wpdb \wpdb */
		global $wpdb;

		$parts = $wpdb->get_results( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'part' AND post_status = 'publish' " );
		foreach ( $parts as $part ) {
			$pb_part_content = trim( get_post_meta( $part->ID, 'pb_part_content', true ) );
			if ( $pb_part_content ) {
				$success = wp_update_post(
					[
						'ID' => $part->ID,
						'post_content' => $pb_part_content,
						'comment_status' => 'closed',
					]
				);
				if ( $success === $part->ID ) {
					delete_post_meta( $part->ID, 'pb_part_content' );
				}
			}
		}

		Book::deleteBookObjectCache();
	}
public function migratePartContentToEditor() {

		/** @var $wpdb \wpdb */
		global $wpdb;

		$parts = $wpdb->get_results( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'part' AND post_status = 'publish' " );
		foreach ( $parts as $part ) {
			$pb_part_content = trim( get_post_meta( $part->ID, 'pb_part_content', true ) );
			if ( $pb_part_content ) {
				$success = wp_update_post(
					[
						'ID' => $part->ID,
						'post_content' => $pb_part_content,
						'comment_status' => 'closed',
					]
				);
				if ( $success === $part->ID ) {
					delete_post_meta( $part->ID, 'pb_part_content' );
				}
			}
		}

		Book::deleteBookObjectCache();
	}
public function migratePartContentToEditor ( ) { /** @var $wpdb \wpdb */ global $ wpdb ; $ parts = $ wpdb -> get_results ( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'part' AND post_status = 'publish' " ) ; foreach ( $ parts as $ part ) { $ pb_part_content = trim ( get_post_meta ( $ part -> ID , 'pb_part_content' , true ) ) ; if ( $ pb_part_content ) { $ success = wp_update_post ( [ 'ID' => $ part -> ID , 'post_content' => $ pb_part_content , 'comment_status' => 'closed' , ] ) ; if ( $ success === $ part -> ID ) { delete_post_meta ( $ part -> ID , 'pb_part_content' ) ; } } } Book :: deleteBookObjectCache ( ) ; }
Migrate part content to content editor
Migrate part content to content editor