Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WooCommerce] 商店管理員無法編輯隱私權政策頁面
<?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
You can’t perform that action at this time.