Carbon_Fields\Container\Widget_Container::is_valid_attach PHP Method

is_valid_attach() public method

Perform checks whether the container should be attached during the current request
public is_valid_attach ( ) : boolean
return boolean True if the container is allowed to be attached
    public function is_valid_attach()
    {
        $screen = get_current_screen();
        $is_widget_save = isset($_REQUEST['action']) && $_REQUEST['action'] === 'save-widget';
        return $screen && $screen->id === 'widgets' || $is_widget_save;
    }