Changeset 2223674
- Timestamp:
- 01/07/2020 04:16:15 PM (6 years ago)
- Location:
- wp-similar-basic-auth/trunk
- Files:
-
- 3 edited
-
includes/admin/admin-plugins-page.php (modified) (2 diffs)
-
includes/public/login-page.php (modified) (1 diff)
-
wp-similar-basic-auth.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-similar-basic-auth/trunk/includes/admin/admin-plugins-page.php
r2223360 r2223674 10 10 function __construct() { 11 11 add_filter( 'plugin_action_links', array( $this, 'plugin_settings_link' ) ); 12 add_action( 'activated_plugin', array($this, 'action_activated_plugin') ); 12 13 } 13 14 15 // Add Settings menu in plugins page 14 16 function plugin_settings_link( $link ) { 15 17 global $hax_wsba_config; … … 20 22 array_unshift( $link, $url ); // Settings link first For order 21 23 return $link; 24 } 25 26 public function action_activated_plugin() { 27 global $hax_wsba_config; 28 29 // It need wp_options what use in DB. 30 // register_settings sanitize callback will be launched twice if no wp_options. 31 $init_options = array( 32 $hax_wsba_config->register_settings_title, 33 $hax_wsba_config->register_settings_message, 34 $hax_wsba_config->register_settings_user_name, 35 $hax_wsba_config->register_settings_password 36 ); 37 38 foreach( $init_options as $value) { 39 if ( !get_option( $value ) ) { 40 add_option($value); 41 } 42 } 22 43 } 23 44 -
wp-similar-basic-auth/trunk/includes/public/login-page.php
r2223360 r2223674 67 67 $hax_wsba_cookie = new Hax_Wsba_Cookie(); 68 68 69 // [Pass] If no tset User Name and Password, pass WSBA page.69 // [Pass] If no set User Name and Password, pass WSBA page. 70 70 // It suppose just activate plugin or forget set User Name or Password. 71 if ( $saved_user_name === false || $saved_password === false ) {72 return ' data_does_not_exist'; // For phpunit71 if ( $saved_user_name === false || $saved_password === false || $saved_user_name === '' || $saved_password === '' ) { 72 return 'no_data'; // For phpunit 73 73 } 74 74 -
wp-similar-basic-auth/trunk/wp-similar-basic-auth.php
r2223360 r2223674 56 56 57 57 if ( is_admin() ) { 58 include_once( $hax_wsba_config->path_admin . 'admin-plugins-page.php' ); 58 59 include_once( $hax_wsba_config->path_admin . 'admin-options-page.php' ); 59 include_once( $hax_wsba_config->path_admin . 'admin-plugins-page.php' );60 60 } 61 61 }
Note: See TracChangeset
for help on using the changeset viewer.