• I noticed recently that the Redirection plugin (https://wordpress.org/plugins/redirection/) is using apply_filters on the capability used in its add_menu_page and add_submenu_page calls. This is a very simple change that allows users to more easily modify these permissions if required (as we do).

    It is possible to achieve a similar thing by acting directly on the global menu and submenu objects, but this is a fragile approach that may break depending on modifications to the W3TC code; using apply_filters is a more reliable and wordpress-ish way do to things.

    Perhaps this change could be incorporated? An example from the redirection plugin is shown below.

    add_management_page( __( "Redirection", 'redirection' ), __( "Redirection", 'redirection' ), apply_filters( 'redirection_role', 'administrator' ), basename( REDIRECTION_FILE ), array( &$this, "admin_screen" ) );

    https://wordpress.org/plugins/w3-total-cache/

The topic ‘Feature request: apply_filters on capabilities’ is closed to new replies.