apply_filters( 'relevanssi_acceptable_hooks', array $acceptable_hooks )

Filters the admin page hooks where Relevanssi javascript is added.


(array) An array of page hook names.

More information

Relevanssi includes some javascript code in the WordPress admin dashboard. In order to avoid polluting pages where Relevanssi is not used, the admin scripts are only added to specific page hooks. Here’s the list of default hooks:

'toplevel_page_relevanssi-premium/relevanssi', 'settings_page_relevanssi-premium/relevanssi', 'toplevel_page_relevanssi/relevanssi', 'settings_page_relevanssi/relevanssi', 'dashboard_page_relevanssi_admin_search'

If you want to move Relevanssi admin pages somewhere else (for example the admin search page), you can use this filter hook to add the admin page hook in order to make Relevanssi add the scripts.

add_filter( 'relevanssi_acceptable_hooks', function( array $hooks ) {
    return array_merge( $hooks, array( 'toplevel_page_relevanssi_admin_search' ) );
} );