Skip to content

Instantly share code, notes, and snippets.

@cedriccharles4
cedriccharles4 / functions.php
Last active November 13, 2017 13:57
Temporarily disable a user account
<?php
// Temporarily disable a user account
add_filter( 'authenticate', 'noo_disable_user_account',100,2);
function noo_disable_user_account ($user, $username) {
global $page_contact;
if(!isset($user->data)) return $user;
$user_data = $user->data;
@cedriccharles4
cedriccharles4 / functions.php
Last active November 13, 2017 10:19
Removing Ninja Forms Metabox from post/page edition page
<?php
//Remove Ninja Forms Metabox
add_action( 'do_meta_boxes', 'noo_remove_metaBox_nf');
function noo_remove_metaBox_nf() {
remove_meta_box('ninja_forms_selector', 'post', 'side');
remove_meta_box('ninja_forms_selector', 'page', 'side');
}
@cedriccharles4
cedriccharles4 / wp-config.php
Created November 13, 2017 10:03
Limit number of WP post revisions
<?php
//Limit WP post revisions
define('AUTOSAVE_INTERVAL', 300); // seconds
define('WP_POST_REVISIONS', 3);
@cedriccharles4
cedriccharles4 / functions.php
Last active November 12, 2017 00:04
Yoast SEO : move the metabox in last position
<?php
//Move the YOAST SEO metabox in last position
add_filter( 'wpseo_metabox_prio', 'noo_move_yoast_seo_metabox' );
function noo_move_yoast_seo_metabox() {
return 'high';
}