Skip to content

Use capability filter for settings#33

Merged
joedolson merged 1 commit into
ableplayer:mainfrom
todeveni:patch-1
May 15, 2026
Merged

Use capability filter for settings#33
joedolson merged 1 commit into
ableplayer:mainfrom
todeveni:patch-1

Conversation

@todeveni
Copy link
Copy Markdown
Contributor

Description

Add a filter, so you can allow eg. editors to Able Player settings.

How Has This Been Tested?

By modifying current plugin source locally and with a filter in place. Settings show and are editable for editors.

add_filter(
  'ableplayer_capability',
  static function (): string {
    return 'edit_others_posts';
  }
);

Types of changes

Adds a capability filter

Checklist:

  • My code is tested.
  • My code is backward-compatible with WordPress 4.9 and PHP 7.0.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.

Copy link
Copy Markdown
Member

@joedolson joedolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to refactor this a bit so that it's assigned to a variable and add documentation for the filter, but this is a fine basis for that.

@joedolson joedolson merged commit fe4b048 into ableplayer:main May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants