php base functions.php附加组件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php base functions.php附加组件相关的知识,希望对你有一定的参考价值。

// White label
// Custom login logo
add_action( 'login_enqueue_scripts', 'xmit_replace_login_logo' );
function xmit_replace_login_logo() {
	?><style type="text/css">
		body.login div#login h1 a {
			background-image: url(<?php echo get_stylesheet_directory_uri() ?>/images/logo-login.png) !important;
			background-size: 80px 80px; /* Adjust to the dimensions of your logo. WP Default: 80px 80px */
			padding-bottom: 15px; /* Useful for spacing your logo from the form below. Default: 15px*/
			height: 80px;
			width: 80px;
		}
	    html, body {background: #9FA1A4 !important;}
	    .login #nav, .login #backtoblog {padding:0 !important;}
	    p#nav a, p#backtoblog a {color:white !important;}
	    .wp-core-ui .button-primary {background:#303236 !important;border-color:#000;}
	    .wp-core-ui .button-primary:hover {border-color:#fefefe !important;}    
	</style><?php
}

// Login Screen: Link login screen logo to site's homepage
function xmit_url_login(){
	return get_bloginfo( 'wpurl' );
}
add_filter('login_headerurl', 'xmit_url_login');

// Login Screen: Change login logo hover text
function xmit_login_logo_url_title() {
    return 'Click to return to the site homepage';
}
add_filter( 'login_headertitle', 'xmit_login_logo_url_title' );

// Login Screen: Set 'remember me' to be checked by default
function xmit_login_checked_remember_me() {
	add_filter( 'login_footer', 'xmit_rememberme_checked' );
}
add_action( 'init', 'xmit_login_checked_remember_me' );
function xmit_rememberme_checked() {
	echo "<script>document.getElementById('rememberme').checked = true;</script>";
}

// Login Screen: Don't inform user which piece of credential was incorrect
function xmit_failed_login () {
    return 'The login information you have entered is incorrect. Please try again.';
}
add_filter ( 'login_errors', 'xmit_failed_login' );

// replace WordPress Howdy
function replace_howdy( $wp_admin_bar ) {
$my_account=$wp_admin_bar->get_node('my-account');
$newtitle = str_replace( 'Howdy,', 'You are logged in as', $my_account->title );
$wp_admin_bar->add_node( array(
'id' => 'my-account',
'title' => $newtitle,
) );
}
add_filter( 'admin_bar_menu', 'replace_howdy',25 );


// Modify the admin footer
function xmit_modify_footer_admin () {
    echo '<span id="footer-thankyou">Theme Development by <a href="http://www.transmitstudio.com" target="_blank" rel="nofollow">Transmit Studio</a> &middot; Cleveland | San Jose | Vancouver</span>';
}
add_filter('admin_footer_text', 'xmit_modify_footer_admin');

// Fix annoying admin menu bug for WooSlider v1.0.5 where menu image ghosts
add_action( 'admin_head', 'fix_menu_posts_slide_img' );
function fix_menu_posts_slide_img(){ ?>
     <style>
     #adminmenu #menu-posts-slide .wp-menu-image img {display: none;}
     </style>
<?php
}

以上是关于php base functions.php附加组件的主要内容,如果未能解决你的问题,请参考以下文章

php 将此脚本插入到WordPress主题中的functions.php中(了解开启和关闭的php标记)以允许Gr中的字段组

手机检测php代码functions.php中的Innerhtml

将Facebook跟踪事件附加到Woocommerce的订单收到页面

php functions.php中的主题自定义php代码

functions.php 被siteLock-php-injector 感染了如何清理呢? [关闭]

php 【WordPress的】的functions.php