| 1 |
<?php |
| 2 |
/** |
| 3 |
* Customize tools page. |
| 4 |
* |
| 5 |
* @since 1.8.2 |
| 6 |
* @version 1.8.8.6 |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
$charitable_campaign = Charitable_Campaigns::query( |
| 14 |
array( |
| 15 |
'posts_per_page' => 1, |
| 16 |
'post_status' => 'publish', |
| 17 |
'fields' => 'ids', |
| 18 |
'meta_query' => array( // phpcs:ignore |
| 19 |
'relation' => 'OR', |
| 20 |
array( |
| 21 |
'key' => '_campaign_end_date', |
| 22 |
'value' => date( 'Y-m-d H:i:s' ), // phpcs:ignore |
| 23 |
'compare' => '>=', |
| 24 |
'type' => 'datetime', |
| 25 |
), |
| 26 |
array( |
| 27 |
'key' => '_campaign_end_date', |
| 28 |
'value' => 0, |
| 29 |
'compare' => '=', |
| 30 |
), |
| 31 |
), |
| 32 |
) |
| 33 |
); |
| 34 |
|
| 35 |
if ( $charitable_campaign->found_posts ) { |
| 36 |
$charitable_url = charitable_get_permalink( |
| 37 |
'campaign_donation', |
| 38 |
array( |
| 39 |
'campaign_id' => current( $charitable_campaign->posts ), |
| 40 |
) |
| 41 |
); |
| 42 |
} |
| 43 |
|
| 44 |
if ( ! isset( $charitable_url ) || false === $charitable_url ) { |
| 45 |
$charitable_url = home_url(); |
| 46 |
} |
| 47 |
|
| 48 |
$charitable_customize_link = rawurlencode( $charitable_url ); |
| 49 |
?> |
| 50 |
<div class="charitable-customizer"> |
| 51 |
<div class="charitable-customizer-section"> |
| 52 |
<h2><?php esc_html_e( 'Customize Charitable (Legacy)', 'charitable' ); ?></h2> |
| 53 |
<?php echo '<img width="119" src="' . esc_url( charitable()->get_path( 'assets', false ) . 'images/misc/customizer.png' ) . '" alt="" />'; ?> |
| 54 |
<p> |
| 55 |
<?php |
| 56 |
printf( |
| 57 |
'<p>%s <a target="_blank" href="%s">%s</a> %s</p>', |
| 58 |
esc_html__( 'Previously Charitable had an option in the menu that linked to the ', 'charitable' ), |
| 59 |
esc_url( 'https://www.wpcharitable.com/documentation/customizer-settings/' ), |
| 60 |
esc_html__( 'WordPress Customizer', 'charitable' ), |
| 61 |
esc_html__( 'for a few select settings. That menu link has been moved here.', 'charitable' ), |
| 62 |
); |
| 63 |
?> |
| 64 |
</p> |
| 65 |
<p><?php esc_html_e( 'This link will be depreciated in an upcoming Charitable release.', 'charitable' ); ?></p> |
| 66 |
<p><a href="<?php echo esc_url( admin_url( 'customize.php?autofocus[panel]=charitable&url=' . $charitable_customize_link ) ); ?>" class="button button-primary"><?php esc_html_e( 'Open WordPress Customizer', 'charitable' ); ?></a></p> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
|