Created
August 20, 2024 12:53
-
-
Save Pross/840e2901781b308f6dc9644aebd09d88 to your computer and use it in GitHub Desktop.
Show in pages list if BB layout has unpublished changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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