LLMS_Meta_Box_Access::get_screens()
Determine the screens where the metabox should be rendered.
Description Description
This is determined by finding all public post types and checking if they support the ‘llms-membership-restrictions’ feature.
Return Return
(array)
Source Source
File: includes/admin/post-types/meta-boxes/class.llms.meta.box.access.php
public function get_screens() {
$screens = array();
// Check against all public post types.
$post_types = get_post_types(
array(
'public' => true,
),
'names',
'and'
);
foreach ( $post_types as $post_type ) {
// check if the post type supports membership restrictions.
if ( post_type_supports( $post_type, 'llms-membership-restrictions' ) ) {
$screens[] = $post_type;
}
}
return $screens;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |