Plugin Directory

Changeset 1944778


Ignore:
Timestamp:
09/21/2018 02:03:10 PM (8 years ago)
Author:
storespot
Message:

Admin notice

Location:
storespot
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • storespot/tags/1.0.1/includes/class-storespot-activator.php

    r1939129 r1944778  
    99        ];
    1010        add_option( 'storespot_settings', $options );
     11        set_transient( 'stsp-admin-activation-notice', true, 5 );
    1112
    1213        if ( ! wp_next_scheduled( 'stsp_product_feed_update' ) ) {
  • storespot/tags/1.0.1/storespot.php

    r1939129 r1944778  
    2424}
    2525
     26function stsp_admin_activation_notice() {
     27    /* Check transient, if available display notice */
     28    if( get_transient( 'stsp-admin-activation-notice' ) ){
     29            ?>
     30            <div class="updated notice is-dismissible">
     31                    <p>
     32                        Thank you for installing <strong>StoreSpot</strong>!
     33                        You can now go close this tab and finish setting up your
     34                        account in the StoreSpot app.
     35                    </p>
     36            </div>
     37            <?php
     38            /* Delete transient, only display this notice once. */
     39            delete_transient( 'stsp-admin-activation-notice' );
     40    }
     41}
     42
    2643register_activation_hook( __FILE__, 'activate_storespot' );
    2744register_deactivation_hook( __FILE__, 'deactivate_storespot' );
     45add_action( 'admin_notices', 'stsp_admin_activation_notice' );
    2846
    2947require plugin_dir_path( __FILE__ ) . 'includes/class-storespot.php';
  • storespot/trunk/includes/class-storespot-activator.php

    r1939129 r1944778  
    99        ];
    1010        add_option( 'storespot_settings', $options );
     11        set_transient( 'stsp-admin-activation-notice', true, 5 );
    1112
    1213        if ( ! wp_next_scheduled( 'stsp_product_feed_update' ) ) {
  • storespot/trunk/storespot.php

    r1939129 r1944778  
    2424}
    2525
     26function stsp_admin_activation_notice() {
     27    /* Check transient, if available display notice */
     28    if( get_transient( 'stsp-admin-activation-notice' ) ){
     29            ?>
     30            <div class="updated notice is-dismissible">
     31                    <p>
     32                        Thank you for installing <strong>StoreSpot</strong>!
     33                        You can now go close this tab and finish setting up your
     34                        account in the StoreSpot app.
     35                    </p>
     36            </div>
     37            <?php
     38            /* Delete transient, only display this notice once. */
     39            delete_transient( 'stsp-admin-activation-notice' );
     40    }
     41}
     42
    2643register_activation_hook( __FILE__, 'activate_storespot' );
    2744register_deactivation_hook( __FILE__, 'deactivate_storespot' );
     45add_action( 'admin_notices', 'stsp_admin_activation_notice' );
    2846
    2947require plugin_dir_path( __FILE__ ) . 'includes/class-storespot.php';
Note: See TracChangeset for help on using the changeset viewer.