Created
January 3, 2019 07:36
-
-
Save elicus/10e291a1409219e0e5eefa055e0db39e to your computer and use it in GitHub Desktop.
Remove — Divi string from the WordPress Page/Post/Custom Post Type List
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
function remove_divi_post_status( $post_states, $post ) { | |
// Make sure that $post_states is an array. Third party plugin might modify $post_states and makes it null | |
// which create various issue (i.e. Piklist + Having a page configured as a static page) | |
if ( ! is_array( $post_states ) ) { | |
$post_states = array(); | |
} | |
if ( et_pb_is_pagebuilder_used( $post->ID ) ) { | |
// Remove Divi if existing | |
$key = array_search( 'Divi', $post_states ); | |
if ( false !== $key ) { | |
unset( $post_states[ $key ] ); | |
} | |
} | |
return $post_states; | |
} | |
add_filter('display_post_states','remove_divi_post_status', 11, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment