Automattic / newspack-content-converter

Plugin that enables automated conversion of pre-Gutenberg post content, to Gutenberg blocks content.
GNU General Public License v2.0
46 stars 13 forks source link

adding new actions for post-processing #127

Closed norcross closed 4 months ago

norcross commented 5 months ago

this PR adds 2 new actions to 3 functions (more below). this was a change we made on version we ran on the NASA Flagship site, as we needed to do some data processing once the HTML to Block conversion was done. we felt this would be useful for other folks as well.

do_action( 'ncc_after_post_content_saved', $post_id, $blocks_content_patched, $html_content, $blocks_content );

found in save_converted_post_content this passes the original post ID along with the content parts and newly patched content.

do_action( 'ncc_after_post_table_update', $table, $post_id, $data );

found in update_ncc_posts_table and update_posts_table this passes the original post ID and data array, along with a key indicating which table was updated, currently set to ncc or wp.

please let me know if there are any specific commenting or documentation I should add as well. thanks!

norcross commented 4 months ago

that sounds great to me! i'm looking forward to seeing the newly refactored version as well