File Editor
Directories:
.. (Back)
scripts
styles
Files:
advanced-custom-fields-pro.php
advanced-custom-fields.php
amazon-s3-and-cloudfront-pro.php
amazon-s3-and-cloudfront.php
autoptimize.php
caldera-forms.php
cartflows.php
cdn-enabler.php
coursepress.php
divi-filterable-blog-module.php
divi-module-code-snippet.php
divi-testimonial-slider.php
divi_layout_injector.php
divi_woo_layout_injector.php
dk-pdf.php
ds-divi-rocket.php
easy-digital-downloads.php
eventon.php
events-manager.php
final-tiles-grid-gallery-lite.php
gravityforms.php
gravityformssignature.php
ht-knowledge-base.php
imagify.php
insert-pages.php
jucra-acf-google-maps-for-divi.php
kvcore-idx.php
landing-pages.php
m-chart.php
mappress-google-maps-for-wordpress.php
megamenu.php
modern-events-calendar-lite.php
nex-forms-express-wp-form-builder.php
paid-memberships-pro.php
photo-gallery.php
pilotpress.php
popup-maker.php
relevanssi-premium.php
relevanssi.php
sellsy.php
seo-by-rank-math.php
sfwd-lms.php
sg-cachepress.php
siteorigin-panels.php
sitepress-multilingual-cms.php
table-of-contents-plus.php
the-events-calendar-community-events.php
the-events-calendar.php
toolbar-publish-button.php
woo-paypalplus.php
woocommerce.php
wordpress-mu-domain-mapping.php
wordpress-seo.php
wp-job-manager.php
wp-responsive-table.php
wp-rocket.php
wp-smush-pro.php
wp-smushit.php
wp-views.php
wp3d-models.php
wpml-sticky-links.php
yith-woocommerce-dynamic-pricing-and-discounts-premium.php
Create New File
Create
Edit File: eventon.php
<?php if ( ! defined( 'ABSPATH' ) ) { // Exit if accessed directly. exit; } /** * Compatibility for the EventOn plugin. * * @since 3.10 * * @link http://www.myeventon.com/ */ class ET_Builder_Plugin_Compat_Eventon extends ET_Builder_Plugin_Compat_Base { /** * Event post type. * * @var string */ protected $event_post_type = 'ajde_events'; /** * Constructor. * * @since 3.10 */ public function __construct() { $this->plugin_id = 'eventon/eventon.php'; $this->init_hooks(); } /** * Hook methods to WordPress. * * @since 3.10 * * @return void */ public function init_hooks() { // Bail if there's no version found. if ( ! $this->get_plugin_version() ) { return; } 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. * * @since 3.10 * * @return boolean */ 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. * * @since 3.10 * * @param string[] $post_types * * @return string[] */ public function maybe_filter_post_type_blocklist( $post_types ) { if ( ! $this->uses_default_filter() ) { $post_types[] = $this->event_post_type; } return $post_types; } /** * Maybe filter the supported post type allowlist if the post type is supported. * * @since 3.10 * * @param string[] $post_types * * @return string[] */ public function maybe_filter_third_party_post_types( $post_types ) { if ( $this->uses_default_filter() ) { $post_types[] = $this->event_post_type; } return $post_types; } /** * 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. * * @since 3.10 * * @param string[] $post_types * * @return string[] */ 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 ); } return $post_types; } /** * Maybe disable the FB for a given post if the builder was enabled but the * content filter was switched after that. * * @since 3.10 * * @param boolean $enabled * @param integer $post_id * * @return boolean */ 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() ) { $enabled = false; } return $enabled; } } new ET_Builder_Plugin_Compat_Eventon();
Save Changes
Rename File
Rename