add-ons.php
79 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin Add-ons |
| 4 | * |
| 5 | * @package Give |
| 6 | * @subpackage Admin/Add-ons |
| 7 | * @copyright Copyright (c) 2016, GiveWP |
| 8 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
| 9 | * @since 1.0 |
| 10 | */ |
| 11 | |
| 12 | // Exit if accessed directly. |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Add-ons Page |
| 19 | * |
| 20 | * Renders the add-ons page content. |
| 21 | * |
| 22 | * @return void |
| 23 | * @since 1.0 |
| 24 | */ |
| 25 | function give_add_ons_page() { |
| 26 | ?> |
| 27 | <div class="wrap" id="give-addons"> |
| 28 | |
| 29 | <div class="give-addons-header"> |
| 30 | |
| 31 | <div class="give-admin-logo give-addon-h1"> |
| 32 | <a href="https://givewp.com/&utm_campaign=admin&utm_source=addons&utm_medium=imagelogo" |
| 33 | class="give-admin-logo-link" target="_blank"><img |
| 34 | src="<?php echo GIVE_PLUGIN_URL . 'assets/dist/images/give-logo-large-no-tagline.png'; ?>" |
| 35 | alt="<?php _e( 'Click to Visit GiveWP in a new tab.', 'give' ); ?>"/><span><?php echo esc_html( get_admin_page_title() ); ?></span></a> |
| 36 | </div> |
| 37 | </div> |
| 38 | |
| 39 | <div class="give-subheader give-clearfix"> |
| 40 | |
| 41 | <h1>Give Add-ons</h1> |
| 42 | |
| 43 | <p class="give-subheader-right-text"><?php esc_html_e( 'Maximize your fundraising potential with official add-ons from GiveWP.com.', 'give' ); ?></p> |
| 44 | |
| 45 | <div class="give-hidden"> |
| 46 | <hr class="wp-header-end"> |
| 47 | </div> |
| 48 | </div> |
| 49 | <div class="give-price-bundles-wrap give-clearfix"> |
| 50 | <?php give_add_ons_feed( 'price-bundle' ); ?> |
| 51 | </div> |
| 52 | |
| 53 | <div class="give-addons-directory-wrap give-clearfix"> |
| 54 | <?php give_add_ons_feed( 'addons-directory' ); ?> |
| 55 | </div> |
| 56 | </div> |
| 57 | <?php |
| 58 | |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Enqueue GiveWP font family for just the add-ons page. |
| 63 | * |
| 64 | * @param $hook |
| 65 | */ |
| 66 | function give_addons_enqueue_scripts( $hook ) { |
| 67 | |
| 68 | // Only enqueue on the addons page. |
| 69 | if ( 'give_forms_page_give-addons' !== $hook ) { |
| 70 | return; |
| 71 | } |
| 72 | |
| 73 | // https://fonts.google.com/specimen/Montserrat?selection.family=Montserrat:400,400i,600,600i,700,700i,800,800i |
| 74 | wp_register_style( 'give_addons_font_families', 'https://fonts.googleapis.com/css?family=Montserrat:400,400i,600,600i,700,700i,800,800i', false ); |
| 75 | wp_enqueue_style( 'give_addons_font_families' ); |
| 76 | } |
| 77 | |
| 78 | add_action( 'admin_enqueue_scripts', 'give_addons_enqueue_scripts' ); |
| 79 |