Plugin Directory

Changeset 2852655


Ignore:
Timestamp:
01/22/2023 11:09:46 PM (3 years ago)
Author:
kekotron
Message:

Version 1.2

Location:
ai-post-generator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ai-post-generator/tags/1.2/index.php

    r2848051 r2852655  
    152152
    153153
    154 
     154register_activation_hook( __FILE__, 'ai_post_generator_activation_hook' );
     155
     156function ai_post_generator_activation_hook() {
     157    set_transient( 'ai_post_generator_transient', true, 5 );
     158}
     159
     160add_action( 'admin_notices', 'ai_post_generator_notice' );
     161
     162function ai_post_generator_notice(){
     163
     164    /* Check transient, if available display notice */
     165    if( get_transient( 'ai_post_generator_transient' ) ){
     166
     167        ?>
     168        <div class="updated notice is-dismissible">
     169            <p>Thank you for using AutoWriter! <strong>You are awesome</strong>.</p>
     170        </div>
     171        <script type="text/javascript">
     172            window.location.href= "/wp-admin/admin.php?page=ai_post_generator"
     173        </script>
     174        <?php
     175        /* Delete transient, only display this notice once. */
     176        delete_transient( 'ai_post_generator_transient' );
     177    }
     178}
    155179
    156180
  • ai-post-generator/trunk/index.php

    r2848047 r2852655  
    152152
    153153
    154 
     154register_activation_hook( __FILE__, 'ai_post_generator_activation_hook' );
     155
     156function ai_post_generator_activation_hook() {
     157    set_transient( 'ai_post_generator_transient', true, 5 );
     158}
     159
     160add_action( 'admin_notices', 'ai_post_generator_notice' );
     161
     162function ai_post_generator_notice(){
     163
     164    /* Check transient, if available display notice */
     165    if( get_transient( 'ai_post_generator_transient' ) ){
     166
     167        ?>
     168        <div class="updated notice is-dismissible">
     169            <p>Thank you for using AutoWriter! <strong>You are awesome</strong>.</p>
     170        </div>
     171        <script type="text/javascript">
     172            window.location.href= "/wp-admin/admin.php?page=ai_post_generator"
     173        </script>
     174        <?php
     175        /* Delete transient, only display this notice once. */
     176        delete_transient( 'ai_post_generator_transient' );
     177    }
     178}
    155179
    156180
Note: See TracChangeset for help on using the changeset viewer.