芝麻web文件管理V1.00
编辑当前文件:/www/wwwroot/shphe-en.com/wp-content/plugins/bm-custom-login/bm-custom-login.php
'; echo ''; } /** * */ function custom_login_url( $url ) { return get_home_url(); } /** * */ function custom_login_title ($title) { $cl_options = custom_login_get_options(); if (!empty ($cl_options['cl_powerby'])) { $title = $cl_options['cl_powerby']; } return $title; } /** * * @param
$oldText * @return
*/ function custom_login_admin_footer_text ($old_text) { $cl_options = custom_login_get_options (); if ( ! empty( $cl_options['cl_footertext'] ) ) { return $cl_options['cl_footertext']; } return $old_text; } /** * */ function custom_login_admin_add_page () { add_options_page ('BM Custom Login', 'Custom Login', 'manage_options', CL_PAGE, 'custom_login_options'); } /** * */ function custom_login_options () { ?>
Custom Login Options
More WordPress Goodies ›
If you like this plugin then you may also like my themes on
Pro Theme Design
Pro Theme Design on Twitter
Pro Theme Design on Facebook
'cl_background', 'value' => $vars, 'default' => '', 'description' => __('URL path to image to use for background (sized 312px wide, and around 600px tall so that it can be cropped). You can upload your image with the media uploader', CL_LOCAL), ) ); add_settings_field ( 'cl_powerby', __('Custom Login Powered by:', CL_LOCAL), 'form_text', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_powerby', 'value' => $vars, 'default' => '', 'description' => '', ) ); add_settings_field ( 'cl_footertext', __('WordPress footer text:', CL_LOCAL), 'form_text', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_footertext', 'value' => $vars, 'default' => '', 'description' => __('Appears at the bottom of the admin pages when logged in.', CL_LOCAL), ) ); add_settings_field ( 'cl_backgroundColor', __('Page Background Color:', CL_LOCAL), 'form_text', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_backgroundColor', 'value' => $vars, 'default' => 'eeeeee', 'description' => __('6 digit hex color code', CL_LOCAL), ) ); add_settings_field ( 'cl_backgroundImage', __('Page Background Image:', CL_LOCAL), 'form_text', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_backgroundImage', 'value' => $vars, 'default' => '', 'description' => __('Url path to image to use for the page background', CL_LOCAL), ) ); add_settings_field ( 'cl_backgroundPY', __('Page Background Vertical Position:', CL_LOCAL), 'form_select', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_backgroundPY', 'value' => $vars, 'default' => 'top', 'options' => array ('top', 'center', 'bottom'), 'description' => __('Vertical position of background element', CL_LOCAL), ) ); add_settings_field ( 'cl_backgroundPX', __('Page Background Horizontal Position:', CL_LOCAL), 'form_select', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_backgroundPX', 'value' => $vars, 'default' => 'center', 'options' => array ('left', 'center', 'right'), 'description' => __('Horizontal position of background element', CL_LOCAL), ) ); add_settings_field ( 'cl_backgroundPRepeat', __('Page Background Repeat:', CL_LOCAL), 'form_select', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_backgroundRepeat', 'value' => $vars, 'default' => 'no-repeat', 'options' => array ('no-repeat', 'repeat-x', 'repeat-y', 'repeat'), 'description' => __('Background image repeat', CL_LOCAL), ) ); add_settings_field ( 'cl_color', __('Text Color:', CL_LOCAL), 'form_text', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_color', 'value' => $vars, 'default' => 'ffffff', 'description' => __('6 digit hex color code', CL_LOCAL), ) ); add_settings_field ( 'cl_colorShadow', __('Text Shadow Color:', CL_LOCAL), 'form_text', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_colorShadow', 'value' => $vars, 'default' => '000', 'description' => __('6 digit hex color code', CL_LOCAL), ) ); add_settings_field ( 'cl_linkColor', __('Text Link Color:', CL_LOCAL), 'form_text', CL_PAGE, CL_SECTION, array ( 'id' => 'cl_linkColor', 'value' => $vars, 'default' => '21759B', 'description' => __('6 digit hex color code', CL_LOCAL), ) ); } /** * * @param type $fields * @return type */ function custom_login_validate ($fields) { // colour validation $fields['cl_color'] = str_replace ('#', '', $fields['cl_color']); $fields['cl_color'] = substr ($fields['cl_color'], 0, 6); // shadow colour validation $fields['cl_colorShadow'] = str_replace ('#', '', $fields['cl_colorShadow']); $fields['cl_colorShadow'] = substr ($fields['cl_colorShadow'], 0, 6); // background colour validation $fields['cl_backgroundColor'] = str_replace ('#', '', $fields['cl_backgroundColor']); $fields['cl_backgroundColor'] = substr ($fields['cl_backgroundColor'], 0, 6); // colour validation $fields['cl_linkColor'] = str_replace ('#', '', $fields['cl_linkColor']); $fields['cl_linkColor'] = substr ($fields['cl_linkColor'], 0, 6); // clean image urls $fields['cl_background'] = esc_url_raw ($fields['cl_background']); $fields['cl_backgroundImage'] = esc_url_raw ($fields['cl_backgroundImage']); // sanitize powered by message $fields['cl_powerby'] = esc_html ($fields['cl_powerby']); $fields['cl_powerby'] = strip_tags ($fields['cl_powerby']); return $fields; } /** * * @param type $fields * @return type */ function custom_login_section_validate ($fields) { return $fields; } /** * * @param type $args */ function form_text ($args) { // defaults $id = ''; $value = ''; $description = ''; // set values if (!empty ($args['value'][$args['id']])) { $value = $args['value'][$args['id']]; } else { if (!empty ($args['default'])) { $value = $args['default']; } } if (!empty ($args['description'])) { $description = $args['description']; } $id = $args['id']; ?>
' . $description . '
'; } } /** * * @param type $args */ function form_select ($args) { // defaults $id = ''; $value = ''; $options = array(); $description = ''; if (!empty($args['options'])) { $options = $args['options']; } if (!empty($args['value'][$args['id']])) { $value = $args['value'][$args['id']]; } else { if (!empty ($args['default'])) { $value = $args['default']; } } if (!empty ($args['description'])) { $description = $args['description']; } $id = $args['id']; // display select box options list if ($options) { echo '
'; foreach ($options as $o) { $selected = ''; if ($o == $value) { $selected = ' selected="selected" '; } echo '
' . $o . '
'; } echo '
'; } if (!empty ($description)) { echo '
' . $description . '
'; } } add_action( 'admin_init', 'custom_login_init' ); add_action( 'admin_menu', 'custom_login_admin_add_page' ); add_action( 'login_head', 'bm_custom_login' ); add_filter( 'login_headerurl', 'custom_login_url' ); add_filter( 'login_headertitle', 'custom_login_title' ); add_filter( 'admin_footer_text', 'custom_login_admin_footer_text' );