LLMS_Blocks_Post_Visibility::register_meta()

Register custom meta fields.


Return Return

(void)


Top ↑

Source Source

File: libraries/lifterlms-blocks/includes/class-llms-blocks-post-visibility.php

	public function register_meta() {

		foreach ( array( 'course', 'llms_membership' ) as $post_type ) {

			register_rest_field(
				$post_type,
				'visibility',
				array(
					'get_callback'    => array( $this, 'get_callback' ),
					'update_callback' => array( $this, 'update_callback' ),
					'schema'          => array(
						'description' => __( 'Post visibility.', 'lifterlms' ),
						'type'        => 'object',
						'context'     => array( 'view', 'edit' ),
						'properties'  => array(),
						'arg_options' => array(
							'sanitize_callback' => null,
							'validate_callback' => null,
						),
					),
				)
			);

		}

	}

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.