Add force pull functionality and improve post content handling
This commit is contained in:
@@ -386,9 +386,18 @@ function oribi_sync_push_page( int $post_id, array $opts = [] ): array {
|
||||
}
|
||||
|
||||
// ── Generate content ──────────────────────────────────────────────────
|
||||
$slug = $post->post_name;
|
||||
$title = $post->post_title;
|
||||
$wp_content = $post->post_content;
|
||||
$slug = $post->post_name;
|
||||
$title = $post->post_title;
|
||||
|
||||
// Read post_content directly from the DB — bypassing every get_post()
|
||||
// filter — so we get exactly what oribi_sync_save_post() wrote.
|
||||
global $wpdb;
|
||||
$wp_content = (string) $wpdb->get_var(
|
||||
$wpdb->prepare( 'SELECT post_content FROM ' . $wpdb->posts . ' WHERE ID = %d', $post_id )
|
||||
);
|
||||
|
||||
// Clean any corruption baked in by previous syncs (e.g. \u0026amp; artefacts)
|
||||
$wp_content = oribi_sync_clean_block_content( $wp_content );
|
||||
|
||||
$commit_msg = $opts['message'] ?? "Sync: update {$slug} from WordPress";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user