| 1 |
<?php |
| 2 |
|
| 3 |
// Exit if accessed directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Display the legacy add button in the campaign filters box. |
| 10 |
* |
| 11 |
* @author David Bisset |
| 12 |
* @package Charitable/Admin View/Campaigns Page |
| 13 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 14 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 15 |
* @since 1.8.0 |
| 16 |
* @version 1.8.0 |
| 17 |
* @version 1.8.3.5 |
| 18 |
* @version 1.8.8.6 |
| 19 |
*/ |
| 20 |
|
| 21 |
if ( ! empty( $_GET['post_status'] ) && 'trash' === $_GET['post_status'] ) { // phpcs:ignore WordPress.Security.NonceVerification |
| 22 |
return; |
| 23 |
} |
| 24 |
|
| 25 |
// check the advanced setting for disabled legacy campaigns. |
| 26 |
$charitable_disable_legacy_campaign = charitable_get_option( 'disable_campaign_legacy_mode', false ) ? true : false; |
| 27 |
$charitable_disable_legacy_campaign = apply_filters( 'charitable_disable_legacy_campaign', $charitable_disable_legacy_campaign ); |
| 28 |
|
| 29 |
?> |
| 30 |
<div class="alignleft actions charitable-legacy-actions charitable-campaign-legacy-actions"> |
| 31 |
|
| 32 |
<?php if ( ! charitable_disable_legacy_campaigns() ) : ?> |
| 33 |
|
| 34 |
<a href="<?php echo esc_url( admin_url( 'admin.php?page=charitable-campaign-builder&view=template' ) ); ?>" title="<?php esc_attr_e( 'Create A New Modern Campaign', 'charitable' ); ?>" class="campaign-export-with-icon trigger-modal hide-if-no-js" data-trigger-modal><img src="<?php echo esc_url( charitable()->get_path( 'directory', false ) . 'assets/images/icons/add.svg' ); ?>" alt="<?php esc_attr_e( 'Create A New Modern Campaign', 'charitable' ); ?>" /><label><?php esc_html_e( 'Add Modern Campaign', 'charitable' ); ?></label></a> |
| 35 |
|
| 36 |
<?php else : ?> |
| 37 |
|
| 38 |
<a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=campaign' ) ); ?>" title="<?php esc_attr_e( 'Create A New Legacy Campaign', 'charitable' ); ?>" class="campaign-export-with-icon trigger-modal hide-if-no-js" data-trigger-modal><img src="<?php echo esc_url( charitable()->get_path( 'directory', false ) . 'assets/images/icons/add.svg' ); ?>" alt="<?php esc_attr_e( 'Create A New Legacy Campaign', 'charitable' ); ?>" /><label><?php esc_html_e( 'Add Legacy', 'charitable' ); ?></label></a> |
| 39 |
|
| 40 |
<?php endif; ?> |
| 41 |
|
| 42 |
|
| 43 |
</div> |
| 44 |
|