Skip to content

Instantly share code, notes, and snippets.

View erikjoling's full-sized avatar

Erik Joling erikjoling

View GitHub Profile
@erikjoling
erikjoling / no-nonsense-preferred-settings.json
Created March 7, 2023 09:20
Preferred settings to import for the No Nonsense WordPress plugin
{
"r34nono_admin_bar_logout_link": "1",
"r34nono_auto_core_update_send_email_only_on_error": "1",
"r34nono_disable_site_search": "1",
"r34nono_disallow_full_site_editing": "0",
"r34nono_hide_admin_bar_for_logged_in_non_editors": "1",
"r34nono_limit_admin_elements_for_logged_in_non_editors": "1",
"r34nono_login_replace_wp_logo_link": "0",
"r34nono_prevent_block_directory_access": "1",
"r34nono_redirect_admin_to_homepage_for_logged_in_non_editors": "1",
@erikjoling
erikjoling / no-nonsense-preferred-settings.php
Last active December 17, 2022 16:28
Preferred settings for WordPress No Nonsense plugin
<?php
/**
* Easily set the preferred options for No Nonsense
*
* The interface of No Nonsense is nice and intuitive, but it's tedious to set the options for
* each new website again and again. Fortunately we can easily set these manually through
* code since the plugin stores its settings in the database.
*
* This script adds a No Nonsense utility to store all preferred settings at once
*
@erikjoling
erikjoling / wp-restrict-admin-to-user.php
Created July 31, 2018 11:37
Restricting the WordPress admin-area to a specified user
<?php
add_action( 'init', 'ejo_allow_user_only' );
/**
* Restrict Admin section to specified username
*
* Prevent people from using the admin-section.
* Only allow user with username `REPLACE_THIS`
*
* WordPress 4.7.0+