llms_is_editor_block_rendering()

Determine if the current request is a block rendering request in the editor.


Return Return

(bool)


Top ↑

Source Source

File: includes/llms.functions.core.php

function llms_is_editor_block_rendering() {
	if ( ! defined( 'REST_REQUEST' ) || ! is_user_logged_in() ) {
		return false;
	}

	global $wp;

	if ( ! $wp instanceof WP || empty( $wp->query_vars['rest_route'] ) ) {
		return false;
	}

	$route = $wp->query_vars['rest_route'];

	return false !== strpos( $route, '/block-renderer/' );
}


Top ↑

Changelog Changelog

Changelog
Version Description
7.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.