get_noptin_action_url( string $action, string $value = false, bool $empty = false )

Returns the noptin action url


Parameters Parameters

$action

(string) (Required) The action to execute.

$value

(string) (Optional) The value to pass to the action handler.

Default value: false

$empty

(bool) (Optional) Whether or not to use an empty template.

Default value: false


Top ↑

Return Return

(sting)


Top ↑

Source Source

File: includes/functions.php

function get_noptin_action_url( $action, $value = false, $empty = false ) {
	global $wp_rewrite;

	$permalink = get_option( 'permalink_structure' );

	// Ugly urls
	if ( empty( $permalink ) ) {
		return add_query_arg(
			array(
				'noptin_newsletter'  => $action,
				'nv'  => $value,
				'nte' => $empty,
			),
			get_home_url()
		);
	}

	// Pretty permalinks.
	$path = $wp_rewrite->root . "noptin_newsletter/$action";

	return add_query_arg(
		array(
			'nv'  => $value,
			'nte' => $empty,
		),
		get_home_url( null, $path)
	);

}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.0.6Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation