humanmade / humanmade/hm-rewrite
Allow access_rule to be a Callable
Open
- Dominant language
- PHP
- Stars
- 161
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
For custom authentication etc (if a user has to have a specific role for example):
``` php
'access_rule' => function() {
if ( is_super_admin() ) {
return false;
}
global $wp;
return wp_login_url( add_query_arg( $wp->query_string, '', home_url( $wp->request ) ) );
}
```
Contributor guide
Research direction
Locate the access_rule handling in HM_Rewrite and trace how rewrite access rules are evaluated. Add support for a callable access_rule matching the issue's example, then verify that callable rules can allow or redirect access without breaking existing rule behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- authentication, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100