mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-28 11:22:21 +08:00
15 lines
411 B
Text
15 lines
411 B
Text
add_filter( 'acf/settings/show_admin', function () {
|
|
|
|
// Get the current site url.
|
|
$site_url = get_bloginfo( 'url' );
|
|
|
|
// Define an array of protected site urls.
|
|
$protected_urls = array(
|
|
'https://www.example.com',
|
|
'http://staging.example.com'
|
|
);
|
|
|
|
// If the current site URL is in the array of protected URLs, return FALSE
|
|
// to hide the menu.
|
|
return ! in_array( $site_url, $protected_urls );
|
|
} );
|