Switch to the new wp_get_connectors function#301
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@jeffpaul This doesn't necessarily have to go in 0.5.0 but would probably be nice, as I believe the issue this PR addresses will be present in the next beta (at the very least, the new |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #301 +/- ##
=============================================
+ Coverage 58.01% 58.03% +0.01%
Complexity 576 576
=============================================
Files 37 37
Lines 2956 2955 -1
=============================================
Hits 1715 1715
+ Misses 1241 1240 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jeffpaul
left a comment
There was a problem hiding this comment.
Tested with 7.0 nightly and works fine there, I say merge and pull into the 0.5.0 release
|
@dkotter any concern on the plugin check error? |
No, unfortunately that's been failing for a while due to an upstream issue with Plugin Check. Looks like it's been fixed but a new release hasn't gone out |
What?
Switches to the new
wp_get_connectorsfunction and away from private functionsWhy?
While adding support for the new Connectors experience coming in 7.0, we needed a new approach to get all stored AI connectors, so we can alert users when they don't have any connectors in place. I copied the approach that was in WordPress at the time which required the use of some private functions (prefixed with
_).There's now a new
wp_get_connectorsfunction we can use instead, as well as it looks like one of the private functions we were using will be removed, so nice to move away from that.How?
_wp_connectors_get_connector_settingstowp_get_connectors_wp_connectors_get_real_api_keyto just doing a directget_optioncall, as we don't care if the API key is valid in this check, just if it existsUse of AI Tools
None
Testing Instructions
trunkversion of WordPress (as thewp_get_connectorsfunction only exists there at the time of this writing)Settings > Connectorsand ensure you have at least on Connector installed and an API key in placeSettings > AI Experimentsand ensure you don't see any error message at the top of the page about a missing AI connectorSettings > AI Experimentsbut should not get any fatal errors as well as all functionality should still work