-
-
Save divipro/c708b42848f83c5857cac4bf5e22f098 to your computer and use it in GitHub Desktop.
Remove the 'Divi' post status
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
| /** | |
| * Remove 'Divi' from post states. | |
| * | |
| * @param array $post_states Existing post states. | |
| * @param object $post Current post object. | |
| * | |
| * @return array | |
| */ | |
| function divi_removal_filter( $post_states, $post ){ | |
| // Make sure that $post_states is an array. Third party plugin might modify $post_states and makes it null which can create issues | |
| if ( ! is_array( $post_states ) ) { | |
| $post_states = array(); | |
| } | |
| //Check if Divi was used to create the page and remove the 'Divi' status if it exists | |
| if ( et_pb_is_pagebuilder_used( $post->ID ) ) { | |
| $key = array_search( 'Divi', $post_states ); | |
| if ( false !== $key ) { | |
| unset( $post_states[ $key ] ); | |
| } | |
| } | |
| return $post_states; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment