private function getCurrentCategory()
    {
        $category = false;

        if ($this->registry->registry('current_category') && $this->registry->registry('current_category')->getId()) {
            $category = $this->registry->registry('current_category');
        }

        return $category;
    }
private function getCurrentCategory()
    {
        $category = false;

        if ($this->registry->registry('current_category') && $this->registry->registry('current_category')->getId()) {
            $category = $this->registry->registry('current_category');
        }

        return $category;
    }
private function getCurrentCategory ( ) { $ category = false ; if ( $ this -> registry -> registry ( 'current_category' ) && $ this -> registry -> registry ( 'current_category' ) -> getId ( ) ) { $ category = $ this -> registry -> registry ( 'current_category' ) ; } return $ category ; }
Get the currently edited category, if any.

@return \Magento\Catalog\Model\Category
Get the currently edited category if any .