Created
June 4, 2019 15:27
-
-
Save nczz/d5675f2b91e8a530cc3bd2c61e5e4ccb to your computer and use it in GitHub Desktop.
[WooCommerce] 商店管理員無法編輯隱私權政策頁面
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_privacy_page_edit_cap($caps, $cap, $user_id, $args) { | |
if ('manage_privacy_options' === $cap) { | |
$manage_name = is_multisite() ? 'manage_network' : 'manage_options'; | |
$caps = array_diff($caps, [$manage_name]); | |
} | |
return $caps; | |
} | |
add_filter('map_meta_cap', 'add_privacy_page_edit_cap', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment