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
Return Return
(sting)
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) ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.6 | Introduced. |