first commit
This commit is contained in:
27
wp-content/plugins/brizy/compatibilities/events-manager.php
Normal file
27
wp-content/plugins/brizy/compatibilities/events-manager.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* https://wordpress.org/plugins/events-manager/
|
||||
*/
|
||||
class Brizy_Compatibilities_EventsManager {
|
||||
|
||||
public function __construct() {
|
||||
add_action( 'the_content', [ $this, 'the_content' ], 9 );
|
||||
}
|
||||
|
||||
public function the_content( $content ) {
|
||||
global $post;
|
||||
|
||||
$postTypes = [ EM_POST_TYPE_LOCATION, EM_POST_TYPE_EVENT ];
|
||||
$postType = $post->post_type;
|
||||
|
||||
if ( ! in_array( $postType, $postTypes ) || false === strpos( $content, 'brz-root__container' ) ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
$class = $postType == EM_POST_TYPE_LOCATION ? 'EM_Location_Post' : 'EM_Event_Post';
|
||||
|
||||
remove_filter( 'the_content', [ $class, 'the_content' ] );
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user