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.


Top ↑

Return Return

(array)


Top ↑

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;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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