fewbricks\acf\field_group::get_hide_on_screen_settings PHP Méthode

get_hide_on_screen_settings() private méthode

Note that hide and showare mutually exclusive. If you pass anything but false to hide, show will be ignored. Pass (false, []) to apply the values in show.
private get_hide_on_screen_settings ( boolean | array $names_of_items_to_hide = false, boolean | array $names_of_items_to_show = false ) : array
$names_of_items_to_hide boolean | array
$names_of_items_to_show boolean | array
Résultat array
    private function get_hide_on_screen_settings($names_of_items_to_hide = false, $names_of_items_to_show = false)
    {
        $default_items_to_hide = [0 => 'the_content', 1 => 'excerpt', 2 => 'custom_fields', 3 => 'discussion', 4 => 'comments', 5 => 'revisions', 6 => 'slug', 7 => 'author', 8 => 'format', 10 => 'featured_image', 11 => 'categories', 12 => 'tags', 13 => 'send-trackbacks'];
        if ($names_of_items_to_hide !== false) {
            foreach ($default_items_to_hide as $default_item_key => $default_item_name) {
                if (!in_array($default_item_name, $names_of_items_to_hide)) {
                    unset($default_items_to_hide[$default_item_key]);
                }
            }
        } elseif (is_array($names_of_items_to_show)) {
            foreach ($names_of_items_to_show as $name_of_item_to_show) {
                // Find the key of the item in settings having the value of the key we want to show...
                if (false !== ($item_key = array_search($name_of_item_to_show, $default_items_to_hide))) {
                    // ...and remove that item from our settings array.
                    unset($default_items_to_hide[$item_key]);
                }
            }
        }
        return $default_items_to_hide;
    }