`if ( isset( $this->slug ) && $this->slug )` would work here and be simpler.