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.
Return Return
(boolean)
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 );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 1.3.0 | Introduced. |