Plugin Directory

Changeset 3215351


Ignore:
Timestamp:
12/31/2024 01:32:04 PM (15 months ago)
Author:
infowp360
Message:

Version 1.0.2 Update

Location:
wp360-invoice
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • wp360-invoice/tags/1.0.1/README.md

    r3214839 r3215351  
    66Requires at least: 5.2.0
    77Tested up to: 6.7.1
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99Requires PHP: 7.4.8
    1010License: GPLv2 or later
  • wp360-invoice/tags/1.0.1/front/myaccount_invoice_tab.php

    r3214839 r3215351  
    1111}
    1212add_filter( 'woocommerce_account_menu_items', 'wp360invoice_add_invoice_tab_to_my_account', 20 );
    13 function wp360invoice_invoice_endpoint() {
    14     add_rewrite_endpoint( 'wp360_invoice', EP_ROOT | EP_PAGES );
    15 
    16 add_action( 'init', 'wp360invoice_invoice_endpoint' );
    1713function wp360invoice_invoice_query_vars( $vars ) {
    1814    $vars[] = 'wp360_invoice';
  • wp360-invoice/tags/1.0.1/readme.txt

    r3214839 r3215351  
    66Requires at least: 5.2.0
    77Tested up to: 6.7.1
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99Requires PHP: 7.4.8
    1010License: GPLv2 or later
  • wp360-invoice/tags/1.0.1/wp360-invoice.php

    r3214839 r3215351  
    88  Author: wp360
    99  Author URI: https://wp360.in/
    10   Version: 1.0.1
     10  Version: 1.0.2
    1111  Text Domain: wp360-invoice
    1212 ***/
     
    2222     * @since 1.0.0
    2323     */
    24     define('WP360_VERSION', '1.0.0');
     24    define('WP360_VERSION', '1.0.2');
    2525}
    2626
     
    9696    return $plugin_data['Version'];
    9797}
     98
     99
     100// Hook into plugin activation
     101register_activation_hook( __FILE__, 'wp360invoice_plugin_activation_hook' );
     102function wp360invoice_plugin_activation_hook() {
     103    set_transient( 'wp360invoice_flush_rewrite', true, 60 * 60 );
     104}
     105// Hook into plugin update
     106add_action( 'upgrader_process_complete', 'wp360invoice_flush_rewrite_on_update', 10, 2 );
     107function wp360invoice_flush_rewrite_on_update( $upgrader, $options ) {
     108    if ( isset( $options['type'] ) && 'plugin' === $options['type'] && isset( $options['plugins'] ) ) {
     109        // Check if this plugin was updated
     110        if ( in_array( plugin_basename( __FILE__ ), $options['plugins'] ) ) {
     111            set_transient( 'wp360invoice_flush_rewrite', true, 60 * 60 );
     112        }
     113    }
     114}
     115// Hook into 'init' to perform the flush after activation or update
     116add_action( 'init', 'wp360invoice_invoice_endpoint' );
     117function wp360invoice_invoice_endpoint() {
     118    if ( get_transient( 'wp360invoice_flush_rewrite' ) ) {
     119        flush_rewrite_rules();       
     120        delete_transient( 'wp360invoice_flush_rewrite' );
     121    }   
     122    add_rewrite_endpoint( 'wp360_invoice', EP_ROOT | EP_PAGES );
     123}
  • wp360-invoice/trunk/README.md

    r3214855 r3215351  
    66Requires at least: 5.2.0
    77Tested up to: 6.7.1
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99Requires PHP: 7.4.8
    1010License: GPLv2 or later
  • wp360-invoice/trunk/front/myaccount_invoice_tab.php

    r3124326 r3215351  
    1111}
    1212add_filter( 'woocommerce_account_menu_items', 'wp360invoice_add_invoice_tab_to_my_account', 20 );
    13 function wp360invoice_invoice_endpoint() {
    14     add_rewrite_endpoint( 'wp360_invoice', EP_ROOT | EP_PAGES );
    15 
    16 add_action( 'init', 'wp360invoice_invoice_endpoint' );
    1713function wp360invoice_invoice_query_vars( $vars ) {
    1814    $vars[] = 'wp360_invoice';
  • wp360-invoice/trunk/readme.txt

    r3214855 r3215351  
    66Requires at least: 5.2.0
    77Tested up to: 6.7.1
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99Requires PHP: 7.4.8
    1010License: GPLv2 or later
  • wp360-invoice/trunk/wp360-invoice.php

    r3214855 r3215351  
    88  Author: wp360
    99  Author URI: https://wp360.in/
    10   Version: 1.0.1
     10  Version: 1.0.2
    1111  Text Domain: wp360-invoice
    1212 ***/
     
    2222     * @since 1.0.0
    2323     */
    24     define('WP360_VERSION', '1.0.0');
     24    define('WP360_VERSION', '1.0.2');
    2525}
    2626
     
    9696    return $plugin_data['Version'];
    9797}
     98
     99
     100// Hook into plugin activation
     101register_activation_hook( __FILE__, 'wp360invoice_plugin_activation_hook' );
     102function wp360invoice_plugin_activation_hook() {
     103    set_transient( 'wp360invoice_flush_rewrite', true, 60 * 60 );
     104}
     105// Hook into plugin update
     106add_action( 'upgrader_process_complete', 'wp360invoice_flush_rewrite_on_update', 10, 2 );
     107function wp360invoice_flush_rewrite_on_update( $upgrader, $options ) {
     108    if ( isset( $options['type'] ) && 'plugin' === $options['type'] && isset( $options['plugins'] ) ) {
     109        // Check if this plugin was updated
     110        if ( in_array( plugin_basename( __FILE__ ), $options['plugins'] ) ) {
     111            set_transient( 'wp360invoice_flush_rewrite', true, 60 * 60 );
     112        }
     113    }
     114}
     115// Hook into 'init' to perform the flush after activation or update
     116add_action( 'init', 'wp360invoice_invoice_endpoint' );
     117function wp360invoice_invoice_endpoint() {
     118    if ( get_transient( 'wp360invoice_flush_rewrite' ) ) {
     119        flush_rewrite_rules();       
     120        delete_transient( 'wp360invoice_flush_rewrite' );
     121    }   
     122    add_rewrite_endpoint( 'wp360_invoice', EP_ROOT | EP_PAGES );
     123}
Note: See TracChangeset for help on using the changeset viewer.