Changeset 633511
- Timestamp:
- 12/03/2012 02:37:33 PM (13 years ago)
- File:
-
- 1 edited
-
dippler/trunk/main.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dippler/trunk/main.php
r633505 r633511 143 143 function catchQueryParamsAdmin() { 144 144 if ( is_user_logged_in() && is_admin() ) { 145 if ( isSet( $_GET['activate-dippler-theme'] ) ) { 145 global $pagenow; 146 if ( isSet( $_GET['activate-dippler-theme'] ) && $this->isAdminPage( 'themes.php' ) ) { 146 147 //Try to switch to best available theme 147 148 $best_available_theme = $this->getBestTheme(); … … 151 152 } 152 153 } 154 } 155 156 /* 157 * Helper method for admin page check 158 * 159 * If no page value passed, returns is_admin(); 160 * 161 * @return boolean 162 */ 163 164 function isAdminPage( $page = '' ) { 165 global $pagenow; 166 //IF empty page, return WP is_admin() method value 167 if ( empty( $page ) ) { 168 return is_admin(); 169 } 170 //Else check for $pagenow value 171 return ( $pagenow == $page ); 153 172 } 154 173
Note: See TracChangeset
for help on using the changeset viewer.