Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_REST_Access_Plans_Controller::add_subordinate_props( array $to_set, array $saved_props, bool $creating )

Add all the properties which need to be set as consequence of another setting

Description Description

These properties must be compared to the saved value before updating, because if equal they will produce an error(see update_post_meta()).

Top ↑

Parameters Parameters


(array) (Required) Array of properties to be set.


(array) (Required) Array of LLMS_Access_Plan properties as saved in the db.


(bool) (Required) Whether we're in creation or update phase.

Top ↑

Return Return


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/class-llms-rest-access-plans-controller.php

		$props = wp_parse_args( $to_set, $saved_props );

		// Paid plan.
		if ( $props['price'] > 0 ) {

			$subordinate_props['is_free'] = 'no';

			// One-time (no trial).
			if ( 0 === $props['frequency'] ) {
				$subordinate_props['trial_offer'] = 'no';
		} else {

			$subordinate_props['is_free']     = 'yes';
			$subordinate_props['price']       = 0.0;
			$subordinate_props['frequency']   = 0;
			$subordinate_props['on_sale']     = 'no';
			$subordinate_props['trial_offer'] = 'no';


		$to_set = array_merge( $to_set, $subordinate_props );


	 * Remove all the properties that do not need to be set, based on other properties
	 * @since 1.0.0-beta.18

Top ↑

Changelog Changelog

Version Description
1.0.0-beta.25 Allow updating meta with the same value as the stored one.
1.0.0-beta-24 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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