Plugin Directory

Changeset 2943883


Ignore:
Timestamp:
07/26/2023 07:26:07 PM (3 years ago)
Author:
rezaplus
Message:

notice fixed

Location:
twchat/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • twchat/trunk/helpers/notices.php

    r2943170 r2943883  
    6262        }
    6363        // print notice html
    64         return printf('<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr($class), $message, $button);
     64        return sprintf('<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr($class), $message, $button);
    6565    }
    6666}
  • twchat/trunk/twchat.php

    r2943193 r2943883  
    180180    public static function init(){
    181181        if ( ! isset( self::$instance ) && ! ( self::$instance instanceof TWChat_Core ) ) {
     182
     183            // if class TWCH_class_premium is exists, notice the user to deactivate it
     184            if ( class_exists( 'TWCH_class_premium' ) ) {
     185                add_action( 'admin_notices', function(){
     186                    echo '<div class="notice notice-error is-dismissible"><p>' . __( 'TWChat: Please deactivate the premium version of the plugin to avoid conflicts.', 'twchatlang' ) . '</p></div>';
     187                } );
     188                return;
     189            }
     190
    182191            self::$instance = new TWChat_Core();
    183192        }
Note: See TracChangeset for help on using the changeset viewer.