Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/plugin-c...
File: eventon.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
// Exit if accessed directly.
[2] Fix | Delete
exit;
[3] Fix | Delete
}
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Compatibility for the EventOn plugin.
[7] Fix | Delete
*
[8] Fix | Delete
* @since 3.10
[9] Fix | Delete
*
[10] Fix | Delete
* @link http://www.myeventon.com/
[11] Fix | Delete
*/
[12] Fix | Delete
class ET_Builder_Plugin_Compat_Eventon extends ET_Builder_Plugin_Compat_Base {
[13] Fix | Delete
/**
[14] Fix | Delete
* Event post type.
[15] Fix | Delete
*
[16] Fix | Delete
* @var string
[17] Fix | Delete
*/
[18] Fix | Delete
protected $event_post_type = 'ajde_events';
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Constructor.
[22] Fix | Delete
*
[23] Fix | Delete
* @since 3.10
[24] Fix | Delete
*/
[25] Fix | Delete
public function __construct() {
[26] Fix | Delete
$this->plugin_id = 'eventon/eventon.php';
[27] Fix | Delete
$this->init_hooks();
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
/**
[31] Fix | Delete
* Hook methods to WordPress.
[32] Fix | Delete
*
[33] Fix | Delete
* @since 3.10
[34] Fix | Delete
*
[35] Fix | Delete
* @return void
[36] Fix | Delete
*/
[37] Fix | Delete
public function init_hooks() {
[38] Fix | Delete
// Bail if there's no version found.
[39] Fix | Delete
if ( ! $this->get_plugin_version() ) {
[40] Fix | Delete
return;
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
add_filter( 'et_builder_post_type_blocklist', array( $this, 'maybe_filter_post_type_blocklist' ) );
[44] Fix | Delete
add_filter( 'et_builder_third_party_post_types', array( $this, 'maybe_filter_third_party_post_types' ) );
[45] Fix | Delete
add_filter( 'et_builder_post_types', array( $this, 'maybe_filter_builder_post_types' ) );
[46] Fix | Delete
add_filter( 'et_fb_post_types', array( $this, 'maybe_filter_builder_post_types' ) );
[47] Fix | Delete
add_filter( 'et_builder_fb_enabled_for_post', array( $this, 'maybe_filter_fb_enabled_for_post' ), 10, 2 );
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Get whether the EventOn content filter is set to WordPress' default one.
[52] Fix | Delete
*
[53] Fix | Delete
* @since 3.10
[54] Fix | Delete
*
[55] Fix | Delete
* @return boolean
[56] Fix | Delete
*/
[57] Fix | Delete
public function uses_default_filter() {
[58] Fix | Delete
$options = get_option( 'evcal_options_evcal_1' );
[59] Fix | Delete
return ! empty( $options['evo_content_filter'] ) && $options['evo_content_filter'] === 'def';
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Maybe filter the post type blocklist if the post type is not supported.
[64] Fix | Delete
*
[65] Fix | Delete
* @since 3.10
[66] Fix | Delete
*
[67] Fix | Delete
* @param string[] $post_types
[68] Fix | Delete
*
[69] Fix | Delete
* @return string[]
[70] Fix | Delete
*/
[71] Fix | Delete
public function maybe_filter_post_type_blocklist( $post_types ) {
[72] Fix | Delete
if ( ! $this->uses_default_filter() ) {
[73] Fix | Delete
$post_types[] = $this->event_post_type;
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
return $post_types;
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* Maybe filter the supported post type allowlist if the post type is supported.
[81] Fix | Delete
*
[82] Fix | Delete
* @since 3.10
[83] Fix | Delete
*
[84] Fix | Delete
* @param string[] $post_types
[85] Fix | Delete
*
[86] Fix | Delete
* @return string[]
[87] Fix | Delete
*/
[88] Fix | Delete
public function maybe_filter_third_party_post_types( $post_types ) {
[89] Fix | Delete
if ( $this->uses_default_filter() ) {
[90] Fix | Delete
$post_types[] = $this->event_post_type;
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
return $post_types;
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
/**
[97] Fix | Delete
* Maybe filter the enabled post type list if the post type has been enabled but the content
[98] Fix | Delete
* filter has been changed back to the unsupported one.
[99] Fix | Delete
*
[100] Fix | Delete
* @since 3.10
[101] Fix | Delete
*
[102] Fix | Delete
* @param string[] $post_types
[103] Fix | Delete
*
[104] Fix | Delete
* @return string[]
[105] Fix | Delete
*/
[106] Fix | Delete
public function maybe_filter_builder_post_types( $post_types ) {
[107] Fix | Delete
if ( ! $this->uses_default_filter() ) {
[108] Fix | Delete
$index = array_search( $this->event_post_type, $post_types );
[109] Fix | Delete
array_splice( $post_types, $index, 1 );
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
return $post_types;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
/**
[116] Fix | Delete
* Maybe disable the FB for a given post if the builder was enabled but the
[117] Fix | Delete
* content filter was switched after that.
[118] Fix | Delete
*
[119] Fix | Delete
* @since 3.10
[120] Fix | Delete
*
[121] Fix | Delete
* @param boolean $enabled
[122] Fix | Delete
* @param integer $post_id
[123] Fix | Delete
*
[124] Fix | Delete
* @return boolean
[125] Fix | Delete
*/
[126] Fix | Delete
public function maybe_filter_fb_enabled_for_post( $enabled, $post_id ) {
[127] Fix | Delete
$post_type = get_post_type( $post_id );
[128] Fix | Delete
[129] Fix | Delete
if ( $post_type === $this->event_post_type && ! $this->uses_default_filter() ) {
[130] Fix | Delete
$enabled = false;
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
return $enabled;
[134] Fix | Delete
}
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
new ET_Builder_Plugin_Compat_Eventon;
[138] Fix | Delete
[139] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function