Skip to content

Instantly share code, notes, and snippets.

define('DOMAIN_CURRENT_SITE', 'your-site.com');
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');
/** MySQL database username */
define('DB_USER', 'username_here');
/** MySQL database password */
define('DB_PASSWORD', 'password_here');
<?
require('../../../../wp=load.php;
etag_start();
header('Service-Worker-Allowed: /');
?>
_wordpressConfig={templateUrl: <?=get_bloginfo('template_url');?> };
<?
readfile('sw.js');
etag_end();
?>
{
"name": "MyTest",
"short_name": "Test",
"theme_color": "#2196f3",
"background_color": "#2196f3",
"display": "standalone",
"scope": "/",
"start_url": "/wpmudev.org"
}
function login_checked_remember_me() {
add_filter( 'login_footer', 'rememberme_checked' );
}
add_action( 'init', 'login_checked_remember_me' );
function rememberme_checked() {
echo "<script>document.getElementById('rememberme').checked = true;</script>";
}
<?php
//remove <?php when you paste inside your functions.php file
function admin_login_redirect( $redirect_to, $request, $user ) {
global $user;
if( isset( $user->roles ) && is_array( $user->roles ) ) {
if( in_array( "administrator", $user->roles ) ) {
return $redirect_to;
}
<?php
//remove <?php when you paste into your functions.php file
function login_error_override()
{
return 'Incorrect login details.';
}
add_filter('login_errors', 'login_error_override');
body.login div#login form#loginform p.submit input#wp-submit {
background-color:#17a8e3 !important;
color: #ffffff;
border: 1px solid #0d9ed9;
margin: 10px 10px 10px 10px;
}
body.login div#login form#loginform input {
font-size: 15px;
color: #555555;
}
body.login div#login h1 a {
background-image: url('login-logo.png');
}