-
Notifications
You must be signed in to change notification settings - Fork 19
friends_browser_extension_actions
github-actions[bot] edited this page May 12, 2026
·
3 revisions
Allows plugins to register actions for the Friends browser extension.
Each action is an associative array with:
-
name(string, required) — label shown in the extension popup. -
url(string, required) — target URL; may contain{current_url}which the extension substitutes with the current page URL (URL-encoded). -
method(string, optional) — if"POST", the extension submits a form instead of opening a link. -
fields(object, optional) — for POST actions, key/value pairs of form fields; values may contain{current_url}(raw) and{page_html}placeholders. -
run(string, optional) — if"inline", the extension handles the response in place instead of opening a new tab. -
inputs(array, optional) — user-editable fields for inline actions. -
category(string, optional) — groups actions under a named header; actions without a category appear under the default "Actions" header.
add_filter( 'friends_browser_extension_actions', function ( $actions, $current_user, $context ) {
$actions[] = array(
'name' => 'Save to Collection',
'url' => home_url( '/collect/?url={current_url}' ),
);
return $actions;
}, 10, 3 );-
array$actionsThe array of actions. -
WP_User$current_userThe current user. -
array$contextBrowser extension request context: key, version, user, and request.
array The modified array of actions.
apply_filters( 'friends_browser_extension_actions', array(), $current_user, $context )