Skip to content

Instantly share code, notes, and snippets.

@Pross
Created August 20, 2024 12:53
Show Gist options
  • Save Pross/840e2901781b308f6dc9644aebd09d88 to your computer and use it in GitHub Desktop.
Save Pross/840e2901781b308f6dc9644aebd09d88 to your computer and use it in GitHub Desktop.
Show in pages list if BB layout has unpublished changes
add_filter( 'display_post_states', function( $post_states, $post ) {
if ( get_post_meta( $post->ID, '_fl_builder_enabled', true ) ) {
$draft = get_post_meta( $post->ID, '_fl_builder_draft', true );
$live = get_post_meta( $post->ID, '_fl_builder_data', true );
if ( '' !== $draft && $draft != $live ) {
$post_states['bb_draft'] = 'Unpublished Changes';
}
}
return $post_states;
}, 1000, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment