Plugin Directory

Changeset 1648458


Ignore:
Timestamp:
04/30/2017 04:37:52 PM (9 years ago)
Author:
happybrain
Message:

Themes

Location:
custom-login-form
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • custom-login-form/tags/2.1/custom-login-form.php

    r1648362 r1648458  
    88*/
    99require_once( plugin_dir_path( __FILE__ ) . 'settings.php' );
    10 
    1110$clf_options = get_option( 'clf_options' );
    12 
    1311function clf_login_stylesheet() {
    1412    wp_enqueue_style( 'custom-login', plugin_dir_url( __FILE__ ) . 'style.css' );
     
    1614}
    1715add_action( 'login_enqueue_scripts', 'clf_login_stylesheet' );
    18 
    1916function clf_login_logo_url() {
    2017    return home_url();
    2118}
    2219add_filter( 'login_headerurl', 'clf_login_logo_url' );
    23 
    2420function clf_login_logo_url_title() {
    2521    return get_bloginfo('name');
    2622}
    2723add_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;
     24function 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
    3935        }
    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']) { ?>
    4837            body.login div#login form#loginform p.submit input#wp-submit {
    4938                background:<?php echo $GLOBALS['clf_options']['clf_text_field_21']; ?> !important;
     
    6352                color:<?php echo $GLOBALS['clf_options']['clf_text_field_22']; ?> !important;
    6453            }
    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
    6863}
    69 
     64add_action( 'login_enqueue_scripts', 'clf_login_style' );
    7065if ($GLOBALS['clf_options']['clf_text_field_23']) {
    7166    function clf_login_footer() {
  • custom-login-form/tags/2.1/settings.php

    r1642594 r1648458  
    11<?php
    2 
    32function clf_add_admin_menu() {
    43    add_options_page( 'Custom Login Form', 'Custom Login Form', 'manage_options', 'custom_login_form', 'clf_options_page' );
    54}
    65add_action( 'admin_menu', 'clf_add_admin_menu' );
    7 
    86function clf_options_exist() {
    97    if( false == get_option( 'clf_options' ) ) {
     
    119    }
    1210}
    13 
    1411function clf_options_init(  ) {
    1512    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    );
    1620    add_settings_section(
    1721        'clf_page_section',
     
    5054}
    5155add_action( 'admin_init', 'clf_options_init' );
    52 
     56function 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 &nbsp;
     60    <input type="radio" name="clf_options[clf_text_field_24]" value="2" <?php checked(2, $clf_options['clf_text_field_24'], true); ?>> Dark &nbsp;
     61    <?php
     62}
    5363function clf_text_field_20_render() {
    5464    $clf_options = get_option( 'clf_options' );
     
    5767    <?php
    5868}
    59 
    6069function clf_text_field_21_render() {
    6170    $clf_options = get_option( 'clf_options' );
     
    6473    <?php
    6574}
    66 
    6775function clf_text_field_22_render() {
    6876    $clf_options = get_option( 'clf_options' );
     
    7179    <?php
    7280}
    73 
    7481function clf_text_field_23_render() {
    7582    $clf_options = get_option( 'clf_options' );
     
    7885    <?php
    7986}
    80 
    8187function clf_options_section_callback() {
    8288    echo __( 'Customize the login form of WordPress.', 'custom-login-form' );
    8389}
    84 
    8590function clf_options_page() {
    8691    ?>
  • custom-login-form/trunk/custom-login-form.php

    r1648362 r1648458  
    88*/
    99require_once( plugin_dir_path( __FILE__ ) . 'settings.php' );
    10 
    1110$clf_options = get_option( 'clf_options' );
    12 
    1311function clf_login_stylesheet() {
    1412    wp_enqueue_style( 'custom-login', plugin_dir_url( __FILE__ ) . 'style.css' );
     
    1614}
    1715add_action( 'login_enqueue_scripts', 'clf_login_stylesheet' );
    18 
    1916function clf_login_logo_url() {
    2017    return home_url();
    2118}
    2219add_filter( 'login_headerurl', 'clf_login_logo_url' );
    23 
    2420function clf_login_logo_url_title() {
    2521    return get_bloginfo('name');
    2622}
    2723add_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;
     24function 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
    3935        }
    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']) { ?>
    4837            body.login div#login form#loginform p.submit input#wp-submit {
    4938                background:<?php echo $GLOBALS['clf_options']['clf_text_field_21']; ?> !important;
     
    6352                color:<?php echo $GLOBALS['clf_options']['clf_text_field_22']; ?> !important;
    6453            }
    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
    6863}
    69 
     64add_action( 'login_enqueue_scripts', 'clf_login_style' );
    7065if ($GLOBALS['clf_options']['clf_text_field_23']) {
    7166    function clf_login_footer() {
  • custom-login-form/trunk/settings.php

    r1642591 r1648458  
    11<?php
    2 
    32function clf_add_admin_menu() {
    43    add_options_page( 'Custom Login Form', 'Custom Login Form', 'manage_options', 'custom_login_form', 'clf_options_page' );
    54}
    65add_action( 'admin_menu', 'clf_add_admin_menu' );
    7 
    86function clf_options_exist() {
    97    if( false == get_option( 'clf_options' ) ) {
     
    119    }
    1210}
    13 
    1411function clf_options_init(  ) {
    1512    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    );
    1620    add_settings_section(
    1721        'clf_page_section',
     
    5054}
    5155add_action( 'admin_init', 'clf_options_init' );
    52 
     56function 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 &nbsp;
     60    <input type="radio" name="clf_options[clf_text_field_24]" value="2" <?php checked(2, $clf_options['clf_text_field_24'], true); ?>> Dark &nbsp;
     61    <?php
     62}
    5363function clf_text_field_20_render() {
    5464    $clf_options = get_option( 'clf_options' );
     
    5767    <?php
    5868}
    59 
    6069function clf_text_field_21_render() {
    6170    $clf_options = get_option( 'clf_options' );
     
    6473    <?php
    6574}
    66 
    6775function clf_text_field_22_render() {
    6876    $clf_options = get_option( 'clf_options' );
     
    7179    <?php
    7280}
    73 
    7481function clf_text_field_23_render() {
    7582    $clf_options = get_option( 'clf_options' );
     
    7885    <?php
    7986}
    80 
    8187function clf_options_section_callback() {
    8288    echo __( 'Customize the login form of WordPress.', 'custom-login-form' );
    8389}
    84 
    8590function clf_options_page() {
    8691    ?>
Note: See TracChangeset for help on using the changeset viewer.