Changeset 1648458
- Timestamp:
- 04/30/2017 04:37:52 PM (9 years ago)
- Location:
- custom-login-form
- Files:
-
- 4 edited
-
tags/2.1/custom-login-form.php (modified) (3 diffs)
-
tags/2.1/settings.php (modified) (7 diffs)
-
trunk/custom-login-form.php (modified) (3 diffs)
-
trunk/settings.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-login-form/tags/2.1/custom-login-form.php
r1648362 r1648458 8 8 */ 9 9 require_once( plugin_dir_path( __FILE__ ) . 'settings.php' ); 10 11 10 $clf_options = get_option( 'clf_options' ); 12 13 11 function clf_login_stylesheet() { 14 12 wp_enqueue_style( 'custom-login', plugin_dir_url( __FILE__ ) . 'style.css' ); … … 16 14 } 17 15 add_action( 'login_enqueue_scripts', 'clf_login_stylesheet' ); 18 19 16 function clf_login_logo_url() { 20 17 return home_url(); 21 18 } 22 19 add_filter( 'login_headerurl', 'clf_login_logo_url' ); 23 24 20 function clf_login_logo_url_title() { 25 21 return get_bloginfo('name'); 26 22 } 27 23 add_filter( 'login_headertitle', 'clf_login_logo_url_title' ); 28 29 if ($GLOBALS['clf_options']['clf_text_field_20']) { 30 function clf_login_logo() {31 $size = getimagesize($GLOBALS['clf_options']['clf_text_field_20']);32 ?>33 <style type="text/css">34 #login h1 a, .login h1 a {35 background-image: url(<?php echo $GLOBALS['clf_options']['clf_text_field_20']; ?>)!important;36 height:<?php echo $size[1]/2; ?>px !important;37 width:<?php echo $size[0]/2; ?>px !important;38 background-size: <?php echo $size[0]/2; ?>px <?php echo $size[1]/2; ?>px !important;24 function clf_login_style() { ?> 25 <style type="text/css"> 26 <?php if ($GLOBALS['clf_options']['clf_text_field_20']) { 27 $size = getimagesize($GLOBALS['clf_options']['clf_text_field_20']); ?> 28 #login h1 a, .login h1 a { 29 background-image: url(<?php echo $GLOBALS['clf_options']['clf_text_field_20']; ?>) !important; 30 height:<?php echo $size[1]/2; ?>px !important; 31 width:<?php echo $size[0]/2; ?>px !important; 32 background-size: <?php echo $size[0]/2; ?>px <?php echo $size[1]/2; ?>px !important; 33 } 34 <?php 39 35 } 40 </style> 41 <?php } 42 add_action( 'login_enqueue_scripts', 'clf_login_logo' ); 43 } 44 45 if ($GLOBALS['clf_options']['clf_text_field_21'] && $GLOBALS['clf_options']['clf_text_field_22']) { 46 function clf_login_colors() { ?> 47 <style type="text/css"> 36 if ($GLOBALS['clf_options']['clf_text_field_21'] && $GLOBALS['clf_options']['clf_text_field_22']) { ?> 48 37 body.login div#login form#loginform p.submit input#wp-submit { 49 38 background:<?php echo $GLOBALS['clf_options']['clf_text_field_21']; ?> !important; … … 63 52 color:<?php echo $GLOBALS['clf_options']['clf_text_field_22']; ?> !important; 64 53 } 65 </style> 66 <?php } 67 add_action( 'login_enqueue_scripts', 'clf_login_colors' ); 54 <?php 55 } 56 if ($GLOBALS['clf_options']['clf_text_field_24'] == 2) { ?> 57 body { background: #222 !important } 58 <?php 59 } 60 ?> 61 </style> 62 <?php 68 63 } 69 64 add_action( 'login_enqueue_scripts', 'clf_login_style' ); 70 65 if ($GLOBALS['clf_options']['clf_text_field_23']) { 71 66 function clf_login_footer() { -
custom-login-form/tags/2.1/settings.php
r1642594 r1648458 1 1 <?php 2 3 2 function clf_add_admin_menu() { 4 3 add_options_page( 'Custom Login Form', 'Custom Login Form', 'manage_options', 'custom_login_form', 'clf_options_page' ); 5 4 } 6 5 add_action( 'admin_menu', 'clf_add_admin_menu' ); 7 8 6 function clf_options_exist() { 9 7 if( false == get_option( 'clf_options' ) ) { … … 11 9 } 12 10 } 13 14 11 function clf_options_init( ) { 15 12 register_setting( 'clf_page', 'clf_options' ); 13 add_settings_field( 14 'clf_text_field_24', 15 __( 'Theme', 'custom-login-form' ), 16 'clf_text_field_24_render', 17 'clf_page', 18 'clf_page_section' 19 ); 16 20 add_settings_section( 17 21 'clf_page_section', … … 50 54 } 51 55 add_action( 'admin_init', 'clf_options_init' ); 52 56 function clf_text_field_24_render() { 57 $clf_options = get_option( 'clf_options' ); 58 ?> 59 <input type="radio" name="clf_options[clf_text_field_24]" value="1" <?php checked(1, $clf_options['clf_text_field_24'], true); ?>> Light 60 <input type="radio" name="clf_options[clf_text_field_24]" value="2" <?php checked(2, $clf_options['clf_text_field_24'], true); ?>> Dark 61 <?php 62 } 53 63 function clf_text_field_20_render() { 54 64 $clf_options = get_option( 'clf_options' ); … … 57 67 <?php 58 68 } 59 60 69 function clf_text_field_21_render() { 61 70 $clf_options = get_option( 'clf_options' ); … … 64 73 <?php 65 74 } 66 67 75 function clf_text_field_22_render() { 68 76 $clf_options = get_option( 'clf_options' ); … … 71 79 <?php 72 80 } 73 74 81 function clf_text_field_23_render() { 75 82 $clf_options = get_option( 'clf_options' ); … … 78 85 <?php 79 86 } 80 81 87 function clf_options_section_callback() { 82 88 echo __( 'Customize the login form of WordPress.', 'custom-login-form' ); 83 89 } 84 85 90 function clf_options_page() { 86 91 ?> -
custom-login-form/trunk/custom-login-form.php
r1648362 r1648458 8 8 */ 9 9 require_once( plugin_dir_path( __FILE__ ) . 'settings.php' ); 10 11 10 $clf_options = get_option( 'clf_options' ); 12 13 11 function clf_login_stylesheet() { 14 12 wp_enqueue_style( 'custom-login', plugin_dir_url( __FILE__ ) . 'style.css' ); … … 16 14 } 17 15 add_action( 'login_enqueue_scripts', 'clf_login_stylesheet' ); 18 19 16 function clf_login_logo_url() { 20 17 return home_url(); 21 18 } 22 19 add_filter( 'login_headerurl', 'clf_login_logo_url' ); 23 24 20 function clf_login_logo_url_title() { 25 21 return get_bloginfo('name'); 26 22 } 27 23 add_filter( 'login_headertitle', 'clf_login_logo_url_title' ); 28 29 if ($GLOBALS['clf_options']['clf_text_field_20']) { 30 function clf_login_logo() {31 $size = getimagesize($GLOBALS['clf_options']['clf_text_field_20']);32 ?>33 <style type="text/css">34 #login h1 a, .login h1 a {35 background-image: url(<?php echo $GLOBALS['clf_options']['clf_text_field_20']; ?>)!important;36 height:<?php echo $size[1]/2; ?>px !important;37 width:<?php echo $size[0]/2; ?>px !important;38 background-size: <?php echo $size[0]/2; ?>px <?php echo $size[1]/2; ?>px !important;24 function clf_login_style() { ?> 25 <style type="text/css"> 26 <?php if ($GLOBALS['clf_options']['clf_text_field_20']) { 27 $size = getimagesize($GLOBALS['clf_options']['clf_text_field_20']); ?> 28 #login h1 a, .login h1 a { 29 background-image: url(<?php echo $GLOBALS['clf_options']['clf_text_field_20']; ?>) !important; 30 height:<?php echo $size[1]/2; ?>px !important; 31 width:<?php echo $size[0]/2; ?>px !important; 32 background-size: <?php echo $size[0]/2; ?>px <?php echo $size[1]/2; ?>px !important; 33 } 34 <?php 39 35 } 40 </style> 41 <?php } 42 add_action( 'login_enqueue_scripts', 'clf_login_logo' ); 43 } 44 45 if ($GLOBALS['clf_options']['clf_text_field_21'] && $GLOBALS['clf_options']['clf_text_field_22']) { 46 function clf_login_colors() { ?> 47 <style type="text/css"> 36 if ($GLOBALS['clf_options']['clf_text_field_21'] && $GLOBALS['clf_options']['clf_text_field_22']) { ?> 48 37 body.login div#login form#loginform p.submit input#wp-submit { 49 38 background:<?php echo $GLOBALS['clf_options']['clf_text_field_21']; ?> !important; … … 63 52 color:<?php echo $GLOBALS['clf_options']['clf_text_field_22']; ?> !important; 64 53 } 65 </style> 66 <?php } 67 add_action( 'login_enqueue_scripts', 'clf_login_colors' ); 54 <?php 55 } 56 if ($GLOBALS['clf_options']['clf_text_field_24'] == 2) { ?> 57 body { background: #222 !important } 58 <?php 59 } 60 ?> 61 </style> 62 <?php 68 63 } 69 64 add_action( 'login_enqueue_scripts', 'clf_login_style' ); 70 65 if ($GLOBALS['clf_options']['clf_text_field_23']) { 71 66 function clf_login_footer() { -
custom-login-form/trunk/settings.php
r1642591 r1648458 1 1 <?php 2 3 2 function clf_add_admin_menu() { 4 3 add_options_page( 'Custom Login Form', 'Custom Login Form', 'manage_options', 'custom_login_form', 'clf_options_page' ); 5 4 } 6 5 add_action( 'admin_menu', 'clf_add_admin_menu' ); 7 8 6 function clf_options_exist() { 9 7 if( false == get_option( 'clf_options' ) ) { … … 11 9 } 12 10 } 13 14 11 function clf_options_init( ) { 15 12 register_setting( 'clf_page', 'clf_options' ); 13 add_settings_field( 14 'clf_text_field_24', 15 __( 'Theme', 'custom-login-form' ), 16 'clf_text_field_24_render', 17 'clf_page', 18 'clf_page_section' 19 ); 16 20 add_settings_section( 17 21 'clf_page_section', … … 50 54 } 51 55 add_action( 'admin_init', 'clf_options_init' ); 52 56 function clf_text_field_24_render() { 57 $clf_options = get_option( 'clf_options' ); 58 ?> 59 <input type="radio" name="clf_options[clf_text_field_24]" value="1" <?php checked(1, $clf_options['clf_text_field_24'], true); ?>> Light 60 <input type="radio" name="clf_options[clf_text_field_24]" value="2" <?php checked(2, $clf_options['clf_text_field_24'], true); ?>> Dark 61 <?php 62 } 53 63 function clf_text_field_20_render() { 54 64 $clf_options = get_option( 'clf_options' ); … … 57 67 <?php 58 68 } 59 60 69 function clf_text_field_21_render() { 61 70 $clf_options = get_option( 'clf_options' ); … … 64 73 <?php 65 74 } 66 67 75 function clf_text_field_22_render() { 68 76 $clf_options = get_option( 'clf_options' ); … … 71 79 <?php 72 80 } 73 74 81 function clf_text_field_23_render() { 75 82 $clf_options = get_option( 'clf_options' ); … … 78 85 <?php 79 86 } 80 81 87 function clf_options_section_callback() { 82 88 echo __( 'Customize the login form of WordPress.', 'custom-login-form' ); 83 89 } 84 85 90 function clf_options_page() { 86 91 ?>
Note: See TracChangeset
for help on using the changeset viewer.