← All changes
|
includes/endpoints/class-charitable-campaign-widget-endpoint.php
+4
-1
1.7.0
→
1.8.13
View file →
| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * Donate endpoint. |
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Classes/Charitable_Campaign_Widget_Endpoint |
| 6 | 6 | * @author David Bisset |
| 7 | - * @copyright Copyright (c) 2022, WP Charitable LLC | |
| 7 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.5.0 |
| 10 | 10 | * @version 1.6.55 |
| 11 | 11 | */ |
| @@ -49,8 +49,9 @@ | ||
| 49 | 49 | /** |
| 50 | 50 | * Return the endpoint URL. |
| 51 | 51 | * |
| 52 | 52 | * @since 1.5.0 |
| 53 | + * @version 1.8.9.1 | |
| 53 | 54 | * |
| 54 | 55 | * @global WP_Rewrite $wp_rewrite |
| 55 | 56 | * @param array $args Mixed args. |
| 56 | 57 | * @return string |
| @@ -59,9 +60,11 @@ | ||
| 59 | 60 | global $wp_rewrite; |
| 60 | 61 | |
| 61 | 62 | $campaign_id = array_key_exists( 'campaign_id', $args ) ? $args['campaign_id'] : get_the_ID(); |
| 62 | 63 | |
| 64 | + // phpcs:disable WordPress.Security.NonceVerification.Recommended | |
| 63 | 65 | if ( $wp_rewrite->using_permalinks() && ! isset( $_GET['preview'] ) ) { |
| 66 | + // phpcs:enable WordPress.Security.NonceVerification.Recommended | |
| 64 | 67 | $url = trailingslashit( get_permalink( $campaign_id ) ) . 'widget/'; |
| 65 | 68 | } else { |
| 66 | 69 | $url = esc_url_raw( add_query_arg( array( 'widget' => 1 ), get_permalink( $campaign_id ) ) ); |
| 67 | 70 | } |