Easy Digital Downloads
  • Package
  • Function
  • Tree

Packages

  • EDD
    • Admin
      • Actions
      • Add-ons
      • Dashboard
      • Discounts
      • Downloads
      • Export
      • Notices
      • Pages
      • Payments
      • Reports
      • Settings
      • System
      • Upgrades
      • Upload
      • Welcome
    • Cart
    • Checkout
    • Classes
      • API
      • Fees
      • HTML
      • Roles
      • Session
    • Emails
    • Functions
      • AJAX
      • Compatibility
      • Errors
      • Formatting
      • Install
      • Login
      • Taxes
      • Templates
    • Gateways
    • Logging
    • Payments
    • Shortcodes
    • Widgets

Functions

  • edd_admin_addons_notices
  • edd_admin_messages
 1 <?php
 2 /**
 3  * Admin Notices
 4  *
 5  * @package     EDD
 6  * @subpackage  Admin/Notices
 7  * @copyright   Copyright (c) 2013, Pippin Williamson
 8  * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 9  * @since       1.0
10 */
11 
12 // Exit if accessed directly
13 if ( ! defined( 'ABSPATH' ) ) exit;
14 
15 /**
16  * Admin Messages
17  *
18  * @since 1.0
19  * @global $edd_options Array of all the EDD Options
20  * @return void
21  */
22 function edd_admin_messages() {
23     global $edd_options;
24 
25     if ( isset( $_GET['edd-message'] ) && 'discount_updated' == $_GET['edd-message'] && current_user_can( 'manage_shop_discounts' ) ) {
26          add_settings_error( 'edd-notices', 'edd-discount-updated', __( 'Discount code updated.', 'edd' ), 'updated' );
27     }
28 
29     if ( isset( $_GET['edd-message'] ) && 'discount_update_failed' == $_GET['edd-message'] && current_user_can( 'manage_shop_discounts' ) ) {
30         add_settings_error( 'edd-notices', 'edd-discount-updated-fail', __( 'There was a problem updating your discount code, please try again.', 'edd' ), 'error' );
31     }
32 
33     if ( isset( $_GET['edd-message'] ) && 'payment_deleted' == $_GET['edd-message'] && current_user_can( 'view_shop_reports' ) ) {
34         add_settings_error( 'edd-notices', 'edd-payment-deleted', __( 'The payment has been deleted.', 'edd' ), 'updated' );
35     }
36 
37     if ( isset( $_GET['edd-message'] ) && 'email_sent' == $_GET['edd-message'] && current_user_can( 'view_shop_reports' ) ) {
38         add_settings_error( 'edd-notices', 'edd-payment-sent', __( 'The purchase receipt has been resent.', 'edd' ), 'updated' );
39     }
40 
41     if ( isset( $_GET['page'] ) && 'edd-payment-history' == $_GET['page'] && current_user_can( 'view_shop_reports' ) && edd_is_test_mode() ) {
42         add_settings_error( 'edd-notices', 'edd-payment-sent', sprintf( __( 'Note: Test Mode is enabled, only test payments are shown below. %sSettings%s.', 'edd' ), '<a href="' . admin_url( 'edit.php?post_type=download&page=edd-settings' ) . '">', '</a>' ), 'updated' );
43     }
44 
45     if ( ( empty( $edd_options['purchase_page'] ) || 'trash' == get_post_status( $edd_options['purchase_page'] ) ) && current_user_can( 'edit_pages' ) ) {
46         add_settings_error( 'edd-notices', 'set-checkout', sprintf( __( 'No checkout page has been configured. Visit <a href="%s">Settings</a> to set one.', 'edd' ), admin_url( 'edit.php?post_type=download&page=edd-settings' ) ) );
47     }
48 
49     settings_errors( 'edd-notices' );
50 }
51 add_action( 'admin_notices', 'edd_admin_messages' );
52 
53 /**
54  * Admin Add-ons Notices
55  *
56  * @since 1.0
57  * @return void
58 */
59 function edd_admin_addons_notices() {
60     add_settings_error( 'edd-notices', 'edd-addons-feed-error', __( 'There seems to be an issue with the server. Please try again in a few minutes.', 'edd' ), 'error' );
61     settings_errors( 'edd-notices' );
62 }
Easy Digital Downloads API documentation generated by ApiGen 2.8.0