Skip to content

Instantly share code, notes, and snippets.

View anthonyboutinov's full-sized avatar
😎

Anthony Boutinov anthonyboutinov

😎
View GitHub Profile
@anthonyboutinov
anthonyboutinov / wp-includes slash capabilities.php
Created April 8, 2020 00:32
Allow editors in Wordpress to edit Privacy Policy page
// Source: https://wordpress.stackexchange.com/questions/318666/how-to-allow-editor-to-edit-privacy-page-settings-only
// Allow users with the role editor or administrator to edit and delete the privacy policy page (which is not possible per default in multisite instances):
add_action('map_meta_cap', 'custom_manage_privacy_options', 1, 4);
function custom_manage_privacy_options($caps, $cap, $user_id, $args)
{
$user_meta = get_userdata($user_id);
if (array_intersect(['editor', 'administrator'], $user_meta->roles)) {
if ('manage_privacy_options' === $cap) {
$manage_name = is_multisite() ? 'manage_network' : 'manage_options';
$caps = array_diff($caps, [ $manage_name ]);
@anthonyboutinov
anthonyboutinov / .bash_profile
Created February 26, 2018 07:32
BashRC Aliases
[[ -s ~/.bashrc ]] && source ~/.bashrc
@anthonyboutinov
anthonyboutinov / .htaccess
Last active May 28, 2018 07:13
Yeoman Angular HTML5 Mode
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /app/index.html [NC,L]