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_Settings_Notifications::get_notification_settings( obj $controller )
Get settings specific to the current notification type
Description Description
Parameters Parameters
- $controller
-
(obj) (Required) instance of an LLMS_Notification_Controller
Return Return
(array)
Source Source
File: includes/admin/settings/class.llms.settings.notifications.php
private function get_notification_settings( $controller ) { $settings = array(); // setup vars $type = sanitize_text_field( $_GET['type'] ); $types = $controller->get_supported_types(); $title = $controller->get_title() . ' (' . $types[ $type ] . ')'; $view = $controller->get_mock_view( $type ); // so the merge code button can use it i $this->view = $view; // output the merge code button for the WYSIWYG editor add_action( 'media_buttons', array( $this, 'merge_code_button' ) ); // add a breadcrumb on the top of the page $settings[] = $this->get_breadcrumbs( $title ); // add field options for the view $settings = array_merge( $settings, $view->get_field_options( $type ) ); $subscribers = $controller->get_subscriber_options( $type ); foreach ( $subscribers as $i => $data ) { $sub_settings = array( 'default' => $data['enabled'], 'desc' => $data['title'], 'id' => sprintf( '%1$s[%2$s]', $controller->get_option_name( $type . '_subscribers' ), $data['id'] ), 'type' => 'checkbox', ); if ( 0 === $i ) { $sub_settings['title'] = __( 'Subscribers', 'lifterlms' ); $sub_settings['checkboxgroup'] = 'start'; } elseif ( count( $subscribers ) - 1 === $i ) { $sub_settings['checkboxgroup'] = 'end'; } else { $sub_settings['checkboxgroup'] = 'middle'; } $settings[] = $sub_settings; if ( 'custom' === $data['id'] ) { $settings[] = array( 'desc' => '<br>' . $data['description'], 'id' => $controller->get_option_name( $type . '_custom_subscribers' ), 'type' => 'text', ); } } if ( $controller->is_testable( $type ) ) { foreach ( $controller->get_test_settings( $type ) as $setting ) { $setting['id'] = 'llms_notification_test_data[' . $setting['id'] . ']'; $settings[] = $setting; } } return apply_filters( 'llms_notification_settings_' . $controller->id . '_' . $type, $settings, $controller, $view ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.8.0 | Introduced. |