# ultimate-post/5.0.18/addons/divi/init.php

Post Grid Gutenberg Blocks – PostX, version 5.0.18. 20 lines.

- Page: https://pluginprobe.com/plugins/ultimate-post/5.0.18/code/addons/divi/init.php
- Raw: https://pluginprobe.com/plugins/ultimate-post/5.0.18/raw/addons/divi/init.php
- Modified: 2026-05-06T11:00:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ultimate-post/5.0.18/code/addons/divi/init.php#L10-L20`.

```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' );

```
