PUM_Cookies::register_cookies()

Registers all known cookies when called.


Description Description


Source Source

File: classes/Cookies.php

	public function register_cookies() {
		$cookies = apply_filters( 'pum_registered_cookies', array(
			'on_popup_close'                  => array(
				'name' => __( 'On Popup Close', 'popup-maker' ),
			),
			'on_popup_open'                   => array(
				'name' => __( 'On Popup Open', 'popup-maker' ),
			),
			'form_submission'                 => [
				'name'   => __( 'Form Submission', 'popup-maker' ),
				'fields' => array_merge_recursive( $this->cookie_fields(), [
					'general' => [
						'form'          => [
							'type'    => 'select',
							'label'   => __( 'Form', 'popup-maker' ),
							'options' => $this->preload_posts ? array_merge( [
								'any'                              => __( 'Any Supported Form*', 'popup-maker' ),
								__( 'Popup Maker', 'popup-maker' ) => [
									'pumsubform' => __( 'Subscription Form', 'popup-maker' ),
								],
							], PUM_Integrations::get_integrated_forms_selectlist() ) : array(),
							'pri'     => - 1,
							'std'     => 'any',
						],
						'only_in_popup' => [
							'type'  => 'checkbox',
							'label' => __( 'Only in this popup', 'popup-maker' ),
							'std'   => '1',
						],
					],
				] ),
			],
			'pum_sub_form_success'            => array(
				'name' => __( 'Subscription Form: Successful', 'popup-maker' ),
			),
			'pum_sub_form_already_subscribed' => array(
				'name' => __( 'Subscription Form: Already Subscribed', 'popup-maker' ),
			),
			'manual'                          => array(
				'name' => __( 'Manual', 'popup-maker' ),
				'settings_column' => '<pre class="manual-cookie-shortcode"><code>[popup_cookie name="{{data.name}}" expires="{{data.time}}" sitewide="{{data.path ? 1 : 0}}"]</code></pre>',
			),
		) );

		// @deprecated filter.
		$cookies = apply_filters( 'pum_get_cookies', $cookies );

		$this->add_cookies( $cookies );
	}


Top ↑

User Contributed Notes User Contributed Notes

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