I have a page created by a plugin (Dokan) called Products: example.com/dashboard/products
The /dashboard/products page is created by a rewrite rule, it's not an actual page which can be seen in the admin panel. Therefore I can't use this conditional: is_page(page-id).
How else could I do a WordPress conditional to check the page is the /dashboard/products page?
This is the register_rule function code from the plugin:
$this->query_vars = apply_filters( 'dokan_query_var_filter', array(
'products',
'new-product',
'orders',
'withdraw',
'settings',
'edit-account'
) );
foreach ( $this->query_vars as $var ) {
add_rewrite_endpoint( $var, EP_PAGES );
}
My end goal is to wrap these two lines in a conditional so they only run when on the /dashboard/products
page:
add_action( 'dokan_dashboard_content_inside_before', 'custom_dashboard_menu', 10 );
add_action( 'dokan_dashboard_content_before', 'custom_dashboard_header', 10 );