humanmade / humanmade/hm-rewrite

Allow access_rule to be a Callable

Open
#21 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.