Skip to content

feat: take an $args array in the presence functions - #789

Merged
josephfusco merged 15 commits into
mainfrom
feat/presence-args
Oct 8, 2026
Merged

josephfusco merged 15 commits into
mainfrom
feat/presence-args

Conversation

@josephfusco

Copy link
Copy Markdown
Collaborator

This extends #735 to wp_get_presence() and wp_presence_leave() so the whole API reads one way before the Trac proposal shows it, and leaves the _deprecated_argument() notice and the move of the 283 positional test calls to a follow-up, since the old forms still work here.

Related: #735

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Assisting with the signature change, the call rewrite and tests.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🛝 WordPress Playgrounds

Built from 4c3836f

Post locks RTC Synced patterns Settings
Single site Launch post locks, single site Launch RTC, single site Launch synced patterns, single site Launch settings, single site
Multisite Launch post locks, multisite Launch RTC, multisite Launch synced patterns, multisite Launch network settings, multisite

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.91%. Comparing base (312743a) to head (4c3836f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #789      +/-   ##
============================================
+ Coverage     94.84%   94.91%   +0.06%     
  Complexity      268      268              
============================================
  Files            29       29              
  Lines          4058     4107      +49     
============================================
+ Hits           3849     3898      +49     
  Misses          209      209              
Flag Coverage Δ
multisite 94.91% <100.00%> (+0.06%) ⬆️
phpunit 74.21% <100.00%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

github-actions Bot added a commit that referenced this pull request Oct 8, 2026
@josephfusco
josephfusco marked this pull request as ready for review October 8, 2026 13:40
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props iamchitti, huzaifaalmesbah, joefusco.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

i-am-chitti
i-am-chitti previously approved these changes Oct 8, 2026
Comment thread plugins/presence-api/tests/test-functions.php Outdated
@huzaifaalmesbah huzaifaalmesbah mentioned this pull request Oct 8, 2026
1 of 4 tasks

@huzaifaalmesbah huzaifaalmesbah left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The positional fallback reads well and every caller moved over. Two edge cases in wp_presence_positional_args() inline, both reproduced against this branch with wp eval-file. One question: wp_get_presence_by_room_prefix() still takes a positional $timeout, and the README shows it that way; is leaving it out deliberate, or should it take $args too before the Trac proposal?

AI-assisted review (Claude Code, Claude Opus 5.5); findings checked by me.

Comment thread plugins/presence-api/includes/presence.php Outdated
Comment thread plugins/presence-api/includes/presence.php Outdated
@josephfusco josephfusco mentioned this pull request Oct 8, 2026
24 of 36 tasks
github-actions Bot added a commit that referenced this pull request Oct 8, 2026
github-actions Bot added a commit that referenced this pull request Oct 8, 2026
@josephfusco

Copy link
Copy Markdown
Collaborator Author

Leaving wp_get_presence_by_room_prefix() positional is deliberate: it has one optional parameter, and it is not in the API the Trac draft proposes for core. If it gains a second, it should take $args too. Thanks for the careful review!

@josephfusco
josephfusco merged commit 39eb0a6 into main Oct 8, 2026
24 checks passed
@josephfusco
josephfusco deleted the feat/presence-args branch October 8, 2026 18:40
@github-actions github-actions Bot added this to the 0.17.0 milestone Oct 8, 2026
@josephfusco josephfusco added [Type] Enhancement A suggestion for improvement of an existing feature [Area] Database Issues for the wp_presence table and cron cleanup Public API Adds a hook, route, constant, or global that third parties can depend on php Pull requests that update php code labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Database Issues for the wp_presence table and cron cleanup php Pull requests that update php code Public API Adds a hook, route, constant, or global that third parties can depend on [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants