Automatically remove labels for features that are not displayed

Idea created by lcfpdsgh on Feb 14, 2012
    When I turn off some features by unique values when symboloizing a shape file, the feature labels are still displayed on the map layout even though the feature is not displayed, so I have to figure how to write a query to get them to turn off.