Changeset 3097962
- Timestamp:
- 06/05/2024 12:00:26 PM (2 months ago)
- Location:
- custom-dash/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
custom-dash/trunk/custom-dash.php
r3077824 r3097962 9 9 * Plugin Name: Custom Dash 10 10 * Description: This plugin will change the logo on login screen. 11 * Version: 1.0. 211 * Version: 1.0. 12 12 * Author: Arun Sharma 13 13 * Author URI: https://www.imarun.me/ … … 28 28 * Plugin version constants. 29 29 */ 30 define( 'IASCD_PLUGIN_VERSION', '1.0. 2' );30 define( 'IASCD_PLUGIN_VERSION', '1.0.' ); 31 31 32 32 include_once __DIR__ . '/vendor/autoload.php'; -
custom-dash/trunk/includes/Admin/IascdSettings.php
r3077824 r3097962 38 38 public function iascd_general_settings_init() { 39 39 // Register a new setting for "iascd_general" page. 40 register_setting( 'iascd_general', 'iascd_general_options' ); 40 register_setting( 'iascd_general', 'iascd_general_options', 41 array( 42 'type' => 'array', 43 'sanitize_callback' => array( $this, 'iascd_sanitize_fields' ) 44 ) ); 41 45 42 46 // Register a new section in the "iascd_general" page. … … 139 143 public function iascd_general_section_developers_callback( $args ) { 140 144 ?> 141 <p id="<?php echo esc_attr( $args['id'] ); ?>"><?php esc_html_e( 'Login s reen logo settings', 'iascd_general' ); ?></p>145 <p id="<?php echo esc_attr( $args['id'] ); ?>"><?php esc_html_e( 'Login sreen logo settings', 'iascd_general' ); ?></p> 142 146 <?php 143 147 } … … 151 155 // Get the value of the setting we've registered with register_setting() 152 156 $iascd_options = get_option( 'iascd_general_options' ); 153 $iascd_options[ $args['label_for'] ] = ( ! empty( $iascd_options[ $args['label_for'] ] ) ) ? $iascd_options[ $args['label_for'] ] : ' sdvdsg';157 $iascd_options[ $args['label_for'] ] = ( ! empty( $iascd_options[ $args['label_for'] ] ) ) ? $iascd_options[ $args['label_for'] ] : ''; 154 158 ?> 155 159 <label><input type="radio" class="<?php echo esc_attr( $args['class'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="iascd_general_options[<?php echo esc_attr( $args['label_for'] ); ?>]" value="text" <?php checked( 'text', $iascd_options[ $args['label_for'] ] ); ?> />Text</label><br /> … … 167 171 // Get the value of the setting we've registered with register_setting() 168 172 $iascd_options = get_option( 'iascd_general_options' ); 169 $iascd_options[ $args['label_for'] ] = $iascd_options[ $args['label_for'] ] ?? "";173 $iascd_options[ $args['label_for'] ] = ; 170 174 ?> 171 175 <input type='text' class="<?php echo esc_attr( $args['class'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="iascd_general_options[<?php echo esc_attr( $args['label_for'] ); ?>]" value="<?php echo esc_attr( $iascd_options[ $args['label_for'] ] ) ?>"> … … 182 186 // Get the value of the setting we've registered with register_setting() 183 187 $iascd_options = get_option( 'iascd_general_options' ); 184 $iascd_options[ $args['label_for'] ] = $iascd_options[ $args['label_for'] ] ?? "";188 $iascd_options[ $args['label_for'] ] = ; 185 189 ?> 186 190 <input type='text' class="<?php echo esc_attr( $args['class'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="iascd_general_options[<?php echo esc_attr( $args['label_for'] ); ?>]" value="<?php echo esc_attr( $iascd_options[ $args['label_for'] ] ) ?>"> … … 198 202 // Get the value of the setting we've registered with register_setting() 199 203 $iascd_options = get_option( 'iascd_general_options' ); 200 $iascd_options[ $args['label_for'] ] = $iascd_options[ $args['label_for'] ] ?? "";204 $iascd_options[ $args['label_for'] ] = ; 201 205 ?> 202 206 <input type='text' class="<?php echo esc_attr( $args['class'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="iascd_general_options[<?php echo esc_attr( $args['label_for'] ); ?>]" value="<?php echo esc_attr( $iascd_options[ $args['label_for'] ] ) ?>"> … … 213 217 // Get the value of the setting we've registered with register_setting() 214 218 $iascd_options = get_option( 'iascd_general_options' ); 215 $iascd_options[ $args['label_for'] ] = $iascd_options[ $args['label_for'] ] ?? "";219 $iascd_options[ $args['label_for'] ] = ; 216 220 ?> 217 221 <input type='text' class="<?php echo esc_attr( $args['class'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="iascd_general_options[<?php echo esc_attr( $args['label_for'] ); ?>]" value="<?php echo esc_attr( $iascd_options[ $args['label_for'] ] ) ?>"> … … 228 232 // Get the value of the setting we've registered with register_setting() 229 233 $iascd_options = get_option( 'iascd_general_options' ); 230 $iascd_options[ $args['label_for'] ] = $iascd_options[ $args['label_for'] ] ?? "";234 $iascd_options[ $args['label_for'] ] = ; 231 235 ?> 232 236 <input type='text' class="<?php echo esc_attr( $args['class'] ); ?>" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="iascd_general_options[<?php echo esc_attr( $args['label_for'] ); ?>]" value="<?php echo esc_attr( $iascd_options[ $args['label_for'] ] ) ?>"> … … 257 261 return; 258 262 } 259 263 260 264 // show error/update messages 261 265 settings_errors( 'iascd_general_messages' ); … … 278 282 } 279 283 280 public function iascd_settings_link( $links) {284 public function iascd_settings_link() { 281 285 $settings_link = '<a href="options-general.php?page=iascd_general">Settings</a>'; 282 286 array_unshift( $links, $settings_link ); … … 284 288 return $links; 285 289 } 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 286 334 } -
custom-dash/trunk/includes/IascdPlugin.php
r3077824 r3097962 81 81 public function iascd_login_logo_css_cb() { 82 82 $iascd_options = get_option( 'iascd_general_options' ); 83 $this->iascd_text_or_logo = ( isset( $iascd_options['iascd_general_text_or_logo'] ) && ! empty( $iascd_options['iascd_general_text_or_logo'] ) ) ? $iascd_options['iascd_general_text_or_logo']: '';84 $this->iascd_logo_text = ( isset( $iascd_options['iascd_general_text_logo'] ) && ! empty( $iascd_options['iascd_general_text_logo'] ) ) ? $iascd_options['iascd_general_text_logo']: '';85 $this->iascd_logo_url = ( isset( $iascd_options['iascd_general_login_logo'] ) && ! empty( $iascd_options['iascd_general_login_logo'] ) ) ? $iascd_options['iascd_general_login_logo']: '';86 $this->iascd_logo_height = ( isset( $iascd_options['iascd_general_logo_height'] ) && ! empty( $iascd_options['iascd_general_logo_height'] ) ) ? $iascd_options['iascd_general_logo_height']. 'px' : '84px';87 $this->iascd_logo_width = ( isset( $iascd_options['iascd_general_logo_width'] ) && ! empty( $iascd_options['iascd_general_logo_width'] ) ) ? $iascd_options['iascd_general_logo_width']. 'px' : '84px';88 $this->iascd_login_header_url = ( isset( $iascd_options['iascd_general_login_header_url'] ) && ! empty( $iascd_options['iascd_general_login_header_url'] ) ) ? $iascd_options['iascd_general_login_header_url']: '';83 $this->iascd_text_or_logo = ( isset( $iascd_options['iascd_general_text_or_logo'] ) && ! empty( $iascd_options['iascd_general_text_or_logo'] ) ) ? : ''; 84 $this->iascd_logo_text = ( isset( $iascd_options['iascd_general_text_logo'] ) && ! empty( $iascd_options['iascd_general_text_logo'] ) ) ? : ''; 85 $this->iascd_logo_url = ( isset( $iascd_options['iascd_general_login_logo'] ) && ! empty( $iascd_options['iascd_general_login_logo'] ) ) ? : ''; 86 $this->iascd_logo_height = ( isset( $iascd_options['iascd_general_logo_height'] ) && ! empty( $iascd_options['iascd_general_logo_height'] ) ) ? . 'px' : '84px'; 87 $this->iascd_logo_width = ( isset( $iascd_options['iascd_general_logo_width'] ) && ! empty( $iascd_options['iascd_general_logo_width'] ) ) ? . 'px' : '84px'; 88 $this->iascd_login_header_url = ( isset( $iascd_options['iascd_general_login_header_url'] ) && ! empty( $iascd_options['iascd_general_login_header_url'] ) ) ? : ''; 89 89 90 90 if ( empty( $this->iascd_text_or_logo ) ) { … … 104 104 if ( ! empty( $this->iascd_logo_url ) ) { 105 105 echo '<style type="text/css"> h1 a { 106 background-image:url( ' . esc_ attr( $this->iascd_logo_url ) . ' ) !important;106 background-image:url( ' . esc_( $this->iascd_logo_url ) . ' ) !important; 107 107 height:' . esc_attr( $this->iascd_logo_height ) . ' !important; 108 108 width:' . esc_attr( $this->iascd_logo_width ) . ' !important;
Note: See TracChangeset
for help on using the changeset viewer.