| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
function ultp_divi_builder() { |
| 5 |
if ( ultimate_post()->get_setting( 'ultp_divi' ) == 'true' ) { |
| 6 |
if ( class_exists( 'ET_Builder_Module' ) ) { |
| 7 |
require_once ULTP_PATH . '/addons/divi/divi.php'; |
| 8 |
|
| 9 |
$action = isset( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 10 |
$post_id = isset( $_GET['post'] ) ? sanitize_text_field( $_GET['post'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 11 |
if ( $action && $post_id ) { |
| 12 |
if ( get_post_type( $post_id ) == 'ultp_templates' ) { |
| 13 |
add_filter( 'et_builder_enable_classic_editor', '__return_false' ); |
| 14 |
} |
| 15 |
} |
| 16 |
} |
| 17 |
} |
| 18 |
} |
| 19 |
add_action( 'init', 'ultp_divi_builder' ); |
| 20 |
|