Skip to content

Add generic actions filter for the browser extension#642

Merged
akirk merged 2 commits into
mainfrom
browser-extension-actions
Apr 4, 2026
Merged

Add generic actions filter for the browser extension#642
akirk merged 2 commits into
mainfrom
browser-extension-actions

Conversation

@akirk
Copy link
Copy Markdown
Owner

@akirk akirk commented Apr 4, 2026

Summary

  • Replace the friends_browser_extension_rest_info filter with a dedicated friends_browser_extension_actions filter on the /wp-json/friends/v1/extension endpoint
  • Any plugin can now register actions (with name, url, optional method and fields) shown in the browser extension popup
  • Validates that each action has a string name and url, filtering out malformed entries
  • Includes PHPDoc with @param/@return and an example for extract-wp-hooks documentation

Test plan

  • Verify the /wp-json/friends/v1/extension endpoint returns an actions array when authenticated
  • Register a custom action via the filter and confirm it appears in the response
  • Confirm malformed actions (missing name/url) are excluded from the response

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Fixed - for any bug fixes
  • Removed - for now removed features

Message

Add friends_browser_extension_actions filter to allow plugins to register actions in the browser extension.

Replace the `friends_browser_extension_rest_info` filter with a dedicated
`friends_browser_extension_actions` filter that allows any plugin to
register actions shown in the browser extension popup. Each action has a
name, url, and optional method/fields for POST submissions. Malformed
actions are silently filtered out.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 4, 2026

Test this PR in WordPress Playground

You can test this pull request directly in WordPress Playground:

Launch WordPress Playground

This will install and activate the plugin with the changes from this PR.

@akirk akirk merged commit 62fcbeb into main Apr 4, 2026
@akirk akirk deleted the browser-extension-actions branch April 4, 2026 19:49
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.

1 participant