llms_blocks_is_classic_enabled_for_post( mixed $post )

Determine if the Classic Editor is enabled for a given post.


Parameters Parameters

$post

(mixed) (Required) WP_Post or WP_Post ID.


Top ↑

Return Return

(boolean)


Top ↑

Source Source

File: libraries/lifterlms-blocks/includes/functions-llms-blocks.php

function llms_blocks_is_classic_enabled_for_post( $post ) {

	$ret = false;

	if ( class_exists( 'Classic_Editor' ) ) {

		// Users can choose which editor.
		if ( 'allow' === get_option( 'classic-editor-allow-users', 'disallow' ) ) {

			// check the postmeta to determine which editor we're using.
			$post = get_post( $post );
			if ( $post ) {
				$ret = ( 'classic-editor' === get_post_meta( $post->ID, 'classic-editor-remember', true ) );
			}

			// Uses same editor for all posts.
		} else {

			$ret = ( 'classic' === get_option( 'classic-editor-replace', 'classic' ) );

		}
	}

	return apply_filters( 'llms_blocks_is_classic_enabled_for_post', $ret, $post );

}


Top ↑

Changelog Changelog

Changelog
Version Description
1.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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