HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //var/www/biblioteka/wp-content/plugins/ultimate-post/addons/divi/init.php
<?php
defined( 'ABSPATH' ) || exit;

function ultp_divi_builder() {
	if ( ultimate_post()->get_setting('ultp_divi') == 'true' ) {
		if ( class_exists( 'ET_Builder_Module' ) ) {
			require_once ULTP_PATH.'/addons/divi/divi.php';
			
			$action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended	
			$post_id = isset($_GET['post']) ? sanitize_text_field($_GET['post']) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended	
			if ($action && $post_id) {
				if (get_post_type($post_id) == 'ultp_templates') {
					add_filter( 'et_builder_enable_classic_editor', '__return_false' );
				}
			}
		}
	}
}
add_action( 'init', 'ultp_divi_builder' );