learndash_metabox_save_fields_{$this->settings_metabox_key}

apply_filters( "learndash_metabox_save_fields_{$this->settings_metabox_key}",  array $settings_field_updates,  string $settings_key,  string $settings_screen_id )

Filters settings meta box save fields.


Description #

The dynamic portion of the hook $this->settings_metabox_key refers to the settings key also used as option name while saving settings in options table.


Parameters #

$settings_field_updates

(array) An array of setting fields data.

$settings_key

(string) Settings key used as option name while saving settings.

$settings_screen_id

(string) Settings screen ID.


Source #

File: includes/settings/class-ld-settings-metaboxes.php


Examples #

 <?php
/**
 * Example usage for learndash_metabox_save_fields_{$this->settings_metabox_key} filter.
 */
add_filter(
	'learndash_metabox_save_fields_learndash-course-access-settings',
	function( $settings_field_updates, $settings_key, $settings_screen_id ) {
		// May add any custom logic using $settings_field_updates, $settings_key, $settings_screen_id.

		// Always return $settings_field_updates.
		return $settings_field_updates;
	},
	10,
	3
);