Skip to content

Instantly share code, notes, and snippets.

@cellar-door
cellar-door / gist:8995c273af27d70d61e5984fd979ec94
Created August 28, 2018 20:18
Gutenberg Filter Data on Update
<?php
function test_gutenberg_update( $data, $postarr ) {
$content = $data['post_content'];
if ( empty($content)){
$content = 'Blank Data Overwritten';
}
$data['post_content'] = 'This is an overwrite!';
return $data;
}
### Keybase proof
I hereby claim:
* I am cellar-door on github.
* I am teitzel (https://keybase.io/teitzel) on keybase.
* I have a public key ASCHXYl1Rmlj63MiCsj1Zvu10EeA2eNemMgAaSkAQyJqawo
To claim this, I am signing this object: