: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( ! defined( 'ABSPATH' ) ) {
// Exit if accessed directly.
* Compatibility for the EventOn plugin.
* @link http://www.myeventon.com/
class ET_Builder_Plugin_Compat_Eventon extends ET_Builder_Plugin_Compat_Base {
protected $event_post_type = 'ajde_events';
public function __construct() {
$this->plugin_id = 'eventon/eventon.php';
* Hook methods to WordPress.
public function init_hooks() {
// Bail if there's no version found.
if ( ! $this->get_plugin_version() ) {
add_filter( 'et_builder_post_type_blocklist', array( $this, 'maybe_filter_post_type_blocklist' ) );
add_filter( 'et_builder_third_party_post_types', array( $this, 'maybe_filter_third_party_post_types' ) );
add_filter( 'et_builder_post_types', array( $this, 'maybe_filter_builder_post_types' ) );
add_filter( 'et_fb_post_types', array( $this, 'maybe_filter_builder_post_types' ) );
add_filter( 'et_builder_fb_enabled_for_post', array( $this, 'maybe_filter_fb_enabled_for_post' ), 10, 2 );
* Get whether the EventOn content filter is set to WordPress' default one.
public function uses_default_filter() {
$options = get_option( 'evcal_options_evcal_1' );
return ! empty( $options['evo_content_filter'] ) && $options['evo_content_filter'] === 'def';
* Maybe filter the post type blocklist if the post type is not supported.
* @param string[] $post_types
public function maybe_filter_post_type_blocklist( $post_types ) {
if ( ! $this->uses_default_filter() ) {
$post_types[] = $this->event_post_type;
* Maybe filter the supported post type allowlist if the post type is supported.
* @param string[] $post_types
public function maybe_filter_third_party_post_types( $post_types ) {
if ( $this->uses_default_filter() ) {
$post_types[] = $this->event_post_type;
* Maybe filter the enabled post type list if the post type has been enabled but the content
* filter has been changed back to the unsupported one.
* @param string[] $post_types
public function maybe_filter_builder_post_types( $post_types ) {
if ( ! $this->uses_default_filter() ) {
$index = array_search( $this->event_post_type, $post_types );
array_splice( $post_types, $index, 1 );
* Maybe disable the FB for a given post if the builder was enabled but the
* content filter was switched after that.
* @param boolean $enabled
* @param integer $post_id
public function maybe_filter_fb_enabled_for_post( $enabled, $post_id ) {
$post_type = get_post_type( $post_id );
if ( $post_type === $this->event_post_type && ! $this->uses_default_filter() ) {
new ET_Builder_Plugin_Compat_Eventon;