Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Admin_Settings::fields()

Returns array of pum settings fields.


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Return Return

(mixed)


Top ↑

Source Source

File: classes/Admin/Settings.php

	public static function fields() {

		static $fields;

		if ( ! isset( $fields ) ) {


			$fields = array(
				'general' => array(
					'main' => array(
						'default_theme_id'          => array(
							'label'        => __( 'Default Popup Theme', 'popup-maker' ),
							'dynamic_desc' => sprintf( '%1$s<br/><a id="edit_theme_link" href="%3$s">%2$s</a>', __( 'Choose the default theme used for new popups', 'popup-maker' ), __( 'Customize This Theme', 'popup-maker' ), admin_url( "post.php?action=edit&post={{data.value}}" ) ),
							'type'         => 'select',
							'options'      => pum_is_settings_page() ? PUM_Helpers::popup_theme_selectlist() : null,
							'std'          => pum_get_default_theme_id(),
						),
						'gutenberg_support_enabled' => array(
							'label' => __( 'Enable Block Editor Support', 'popup-maker' ),
							'desc'  => __( 'Enable experimental support for using the block editor to edit popups.', 'popup-maker' ),
							'type'  => 'checkbox',
						),
						'google_fonts_api_key'      => array(
							'type'  => 'text',
							'label' => __( 'Google Fonts API Key *optional', 'popup-maker' ),
							'desc'  => __( 'Enter your own Google Fonts API key to always get the latest fonts available.', 'popup-maker' ),
						),
						'telemetry'      => array(
							'type'  => 'checkbox',
							'label' => __( 'Allow usage tracking?', 'popup-maker' ),
							'desc'  => sprintf(
								/* translators: 1 & 2 are opening and closing HTML of the link around "Learn more" */
								esc_html__( 'Allow data sharing so that we can receive a little information on how it is used and help us make this plugin better? No user data is sent to our servers. No sensitive data is tracked. %1$sLearn more%2$s', 'popup-maker' ),
								' <a target="_blank" rel="noreferrer noopener"  href="https://docs.wppopupmaker.com/article/528-the-data-the-popup-maker-plugin-collects?utm_campaign=contextual-help&utm_medium=inline-doclink&utm_source=settings-page&utm_content=telemetry-setting">',
								'</a>'
							),
						),
					),
				),
			);

			// TODO Remove or move externally of this location later.
			if ( ! ( class_exists( 'PUM_MCI' ) && version_compare( PUM_MCI::$VER, '1.3.0', '<' ) ) ) {
				$fields['subscriptions'] = array(
					'main' => apply_filters( 'pum_newsletter_settings', array(
						'newsletter_default_provider'        => array(
							'label'   => __( 'Default Newsletter Provider', 'popup-maker' ),
							'desc'    => __( 'The default mailing provider used for the subscription form.', 'popup-maker' ),
							'type'    => 'select',
							'options' => array_merge( PUM_Newsletter_Providers::dropdown_list(), array(
								'none' => __( 'None', 'popup-maker' ),
							) ),
						),
						'default_success_message'            => array(
							'label' => __( 'Success Message', 'popup-maker' ),
							'desc'  => __( 'Message to show user when successfuly subscribed.', 'popup-maker' ),
							'type'  => 'text',
							'std'   => __( 'You have been subscribed!', 'popup-maker' ),
						),
						'default_empty_email_message'        => array(
							'label' => __( 'Empty Email Message', 'popup-maker' ),
							'desc'  => __( 'Message to show user when no email is entered.', 'popup-maker' ),
							'type'  => 'text',
							'std'   => __( 'Please enter a valid email.', 'popup-maker' ),
						),
						'default_invalid_email_message'      => array(
							'label' => __( 'Invalid Email Message', 'popup-maker' ),
							'desc'  => __( 'Message to show user when an invalid email is entered.', 'popup-maker' ),
							'type'  => 'text',
							'std'   => __( 'Email provided is not a valid email address.', 'popup-maker' ),
						),
						'default_error_message'              => array(
							'label' => __( 'Error Message', 'popup-maker' ),
							'desc'  => __( 'Message to show user when an error has occurred.', 'popup-maker' ),
							'type'  => 'text',
							'std'   => __( 'Error occurred when subscribing. Please try again.', 'popup-maker' ),
						),
						'default_already_subscribed_message' => array(
							'label' => __( 'Already Subscribed Message', 'popup-maker' ),
							'desc'  => __( 'Message to show user who is already subscribed.', 'popup-maker' ),
							'type'  => 'text',
							'std'   => __( 'You are already a subscriber.', 'popup-maker' ),
						),
						'default_consent_required_message'   => array(
							'label' => __( 'Consent Required Message', 'popup-maker' ),
							'desc'  => __( 'Message to show user who is already subscribed.', 'popup-maker' ),
							'type'  => 'text',
							'std'   => __( 'You must agree to continue.', 'popup-maker' ),
						),
					) ),
				);
			}

			$fields = array_merge( $fields, array(
				'extensions' => array(
					'main' => array(),
				),
				'licenses'   => array(
					'main' => array(),
				),
				'privacy'    => array(
					'main'  => array(
						'disable_popup_open_tracking' => array(
							'type'  => 'checkbox',
							'label' => __( 'Disables popup open tracking?', 'popup-maker' ),
							'desc'  => __( 'This will disable the built in analytics functionality.', 'popup-maker' ),
						),
					),
					'forms' => array(
						'forms_disclaimer'                     => array(
							'type'    => 'html',
							'content' => "<strong>" . __( 'Disclaimer', 'popup-maker' ) . ":</strong> " . __( 'These settings only pertain to usage of the Popup Maker built in subscription form shortcode, not 3rd party form plugins.', 'popup-maker' ),
						),
						'privacy_consent_always_enabled'       => array(
							'label'   => __( 'Always enable consent field on subscription forms.', 'popup-maker' ),
							'type'    => 'select',
							'options' => array(
								'yes' => __( 'Yes', 'popup-maker' ),
								'no'  => __( 'No', 'popup-maker' ),
							),
							'std'     => 'yes',
						),
						'default_privacy_consent_label'        => array(
							'label'        => __( 'Consent Text', 'popup-maker' ),
							'type'         => 'text',
							'std'          => __( 'Notify me about related content and special offers.', 'popup-maker' ),
							'dependencies' => array(
								'privacy_consent_always_enabled' => 'yes',
							),
						),
						'default_privacy_consent_type'         => array(
							'label'        => __( 'Consent Field Type', 'popup-maker' ),
							'desc'         => __( 'Radio forces the user to make a choice, often resulting in more opt-ins.', 'popup-maker' ),
							'type'         => 'select',
							'options'      => array(
								'radio'    => __( 'Radio', 'popup-maker' ),
								'checkbox' => __( 'Checkbox', 'popup-maker' ),
							),
							'std'          => 'radio',
							'dependencies' => array(
								'privacy_consent_always_enabled' => 'yes',
							),
						),
						'default_privacy_consent_required'     => array(
							'label'        => __( 'Consent Required', 'popup-maker' ),
							'type'         => 'checkbox',
							'std'          => pum_get_option( 'default_privacy_consent_required' ),
							'private'      => true,
							'dependencies' => array(
								'privacy_consent_always_enabled' => 'yes',
							),
						),
						'default_privacy_consent_radio_layout' => array(
							'label'        => __( 'Consent Radio Layout', 'popup-maker' ),
							'type'         => 'select',
							'options'      => array(
								'inline'  => __( 'Inline', 'popup-maker' ),
								'stacked' => __( 'Stacked', 'popup-maker' ),
							),
							'std'          => __( 'Yes', 'popup-maker' ),
							'dependencies' => array(
								'privacy_consent_always_enabled' => 'yes',
								'default_privacy_consent_type'   => 'radio',
							),
						),
						'default_privacy_consent_yes_label'    => array(
							'label'        => __( 'Consent Yes Label', 'popup-maker' ),
							'type'         => 'text',
							'std'          => __( 'Yes', 'popup-maker' ),
							'dependencies' => array(
								'privacy_consent_always_enabled' => 'yes',
								'default_privacy_consent_type'   => 'radio',
							),
						),
						'default_privacy_consent_no_label'     => array(
							'label'        => __( 'Consent No Label', 'popup-maker' ),
							'type'         => 'text',
							'std'          => __( 'No', 'popup-maker' ),
							'dependencies' => array(
								'privacy_consent_always_enabled' => 'yes',
								'default_privacy_consent_type'   => 'radio',
							),
						),
						'default_privacy_usage_text'           => array(
							'label'        => __( 'Consent Usage Text', 'popup-maker' ),
							'desc'         => function_exists( 'get_privacy_policy_url' ) ? sprintf( __( 'You can use %1$s%2$s to insert a link to your privacy policy. To customize the link text use %1$s:Link Text%2$s', 'popup-maker' ), '{{privacy_link', '}}' ) : '',
							'type'         => 'text',
							'std'          => __( 'If you opt in above we use this information send related content, discounts and other special offers.', 'popup-maker' ),
							'dependencies' => array(
								'privacy_consent_always_enabled' => 'yes',
							),
						),
					),
				),

				'misc' => array(
					'main'   => array(

						'bypass_adblockers'                    => array(
							'label' => __( 'Try to bypass ad blockers.', 'popup-maker' ),
							'type'  => 'checkbox',
						),
						'adblock_bypass_url_method'            => array(
							'label'        => __( 'Ad blocker: Naming method', 'popup-maker' ),
							'desc'         => __( 'This will help generate unique names for our JavaScript files and the analytics routes.', 'popup-maker' ),
							'type'         => 'select',
							'options'      => array(
								'random' => __( 'Randomize Names', 'popup-maker' ),
								'custom' => __( 'Custom Names', 'popup-maker' ),
							),
							'std'          => 'random',
							'dependencies' => array(
								'bypass_adblockers' => true,
							),
						),
						'adblock_bypass_custom_filename'       => array(
							'type'         => 'text',
							'placeholder'  => 'my-awesome-popups',
							'label'        => __( 'Ad blocker: Custom Name', 'popup-maker' ),
							'desc'         => __( 'A custom & recognizable name to use for our assets.', 'popup-maker' ),
							'dependencies' => array(
								'bypass_adblockers'         => true,
								'adblock_bypass_url_method' => 'custom',
							),
						),
						'adjust_body_padding'   => array(
							'type'  => 'checkbox',
							'label' => __( 'Adjust the right padding added to the body when popups are shown with an overlay.', 'popup-maker' ),
							'desc'  => sprintf(
								/* translators: 1 & 2 are opening and closing HTML of the link around "Learn more" */
								esc_html__( 'Use this if your popups "jump" or "shift" when opened. %1$sLearn more%2$s', 'popup-maker' ),
								'<a target="_blank" rel="noreferrer noopener" href="https://docs.wppopupmaker.com/article/314-why-does-my-site-shift-jump-or-skip-when-a-popup-is-triggered?utm_campaign=contextual-help&utm_medium=inline-doclink&utm_source=settings-page&utm_content=adjust-right-padding">',
								'</a>'
							),
						),
						'body_padding_override' => array(
							'type'         => 'text',
							'placeholder'  => '15px',
							'label'        => __( 'Body Padding Override', 'popup-maker' ),
							'dependencies' => array(
								'adjust_body_padding' => true,
							),
							'std'          => '15px',
						),
						'disabled_admin_bar'                   => array(
							'type'  => 'checkbox',
							'label' => __( 'Disable Popups Admin Bar', 'popup-maker' ),
							'desc'  => __( 'This will disable the admin Popups menu item.', 'popup-maker' ),
						),
						'debug_mode'                           => array(
							'type'  => 'checkbox',
							'label' => __( 'Enable Debug Mode', 'popup-maker' ),
							'desc'  => __( 'This will turn on multiple debug tools used to quickly find issues.', 'popup-maker' ),
						),
						'enable_easy_modal_compatibility_mode' => array(
							'type'  => 'checkbox',
							'label' => __( 'Enable Easy Modal v2 Compatibility Mode', 'popup-maker' ),
							'desc'  => __( 'This will automatically make any eModal classes you have added to your site launch the appropriate Popup after import.', 'popup-maker' ),
						),
						'disable_popup_category_tag'           => array(
							'type'  => 'checkbox',
							'label' => __( 'Disable categories & tags?', 'popup-maker' ),
							'desc'  => __( 'This will disable the popup tags & categories.', 'popup-maker' ),
						),
						'disable_asset_caching'                => array(
							'type'  => 'checkbox',
							'label' => __( 'Disable asset caching.', 'popup-maker' ),
							'desc'  => __( 'By default Popup Maker caches a single JS & CSS file in your Uploads folder. These files include core, extension & user customized styles & scripts in a single set of files.', 'popup-maker' ),
						),
						'disable_shortcode_ui'                 => array(
							'type'  => 'checkbox',
							'label' => __( 'Disable the Popup Maker shortcode button', 'popup-maker' ),
						),
						'disable_tips'                 => array(
							'type'  => 'checkbox',
							'label' => __( 'Disable Popup Maker occasionally showing random tips to improve your popups.', 'popup-maker' ),
						),
						'complete_uninstall'                   => array(
							'type'     => 'checkbox',
							'label'    => __( 'Delete all Popup Maker data on deactivation', 'popup-maker' ),
							'desc'     => __( 'Check this to completely uninstall Popup Maker.', 'popup-maker' ),
							'priority' => 1000,
						),
					),
					'assets' => array(
						'disable_google_font_loading'     => array(
							'type'  => 'checkbox',
							'label' => __( "Don't Load Google Fonts", 'popup-maker' ),
							'desc'  => __( 'Check this disable loading of google fonts, useful if the fonts you chose are already loaded with your theme.', 'popup-maker' ),
						),
						'disable_popup_maker_core_styles' => array(
							'type'  => 'checkbox',
							'label' => __( 'Don\'t load Popup Maker core stylesheet.', 'popup-maker' ),
							'desc'  => __( 'Check this if you have copied the Popup Maker core styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
						),
						'disable_popup_theme_styles'      => array(
							'type'  => 'checkbox',
							'label' => __( 'Don\'t load popup theme styles to the head.', 'popup-maker' ),
							'desc'  => __( 'Check this if you have copied the popup theme styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
						),
						'output_pum_styles'               => array(
							'id'      => 'output_pum_styles',
							'type'    => 'html',
							'content' => self::field_pum_styles(),
						),
					),
				),
			) );

			$fields = apply_filters( 'pum_settings_fields', $fields );

			$fields = PUM_Admin_Helpers::parse_tab_fields( $fields, array(
				'has_subtabs' => true,
				'name'        => 'pum_settings[%s]',
			) );
		}

		return $fields;
	}


Top ↑

User Contributed Notes User Contributed Notes

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