-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hooking in to publish action from share extension? #10742
Comments
cc @aerych as you answered the previous issue mentioned here. |
Hey @ChrisHardie. The share extension publishes a new post by calling The Not sure if this is helpful. Let me know. |
Thanks @aerych - from what I can tell in inspecting traffic between the mobile app and the self-hosted site, everything is being done via XMLRPC, not via the REST API. The post publish action seems to call Obviously the REST API would be preferred but it sounds like XMLRPC is still in place for self-hosted sites for now? Given that, should we keep pursuing why that method apparently doesn't call the Also ccing @jackmcconnell in case you can shed light on the solution you found in the other thread. |
@ChrisHardie I didn't find a solution in the end. Hoping that the REST API will provide a better solution in the future as inserting a post directly via XML-RPC without passing it through many of the post publish hooks will probably cause issues for many plugins, BNFW included. |
Hey @ChrisHardie. The issue description mentioned But you're right, the XML-RPC API is used for self-hosted sites that are not connected to Jetpack, and its using the deprecated |
@ChrisHardie @jackmcconnell Do the v2 REST endpoints for publishing and modifying posts trigger the hooks as expected? |
Just noting again that for now, based on my web server logs, it does seem that the file upload is happening via XML-RPC and not REST endpoints. This is a self-hosted site connected via Jetpack. All of the calls look like |
@ChrisHardie is this how you've been inspecting network traffic between the app and the self-hosted site, or have you been using something like Charles Proxy to view traffic? WordPress.com's REST API makes calls to Jetpack connected blog via the |
Based on the above, its looking like the issue has more to do with the interaction between the WordPress.com API and a Jetpack connected blog and not something specific to the app. If this is the case I think we close the issue here and follow up with the Jetpack team to see what options there might be. |
Hi. I re-architected my solution and am happy to report that hooking in to We can close this issue - thank you for your time on it. |
Expected behavior
For a WordPress theme with custom functionality that hooks into post status transitions (e.g. draft to publish), I expect that post publishing actions taken by the mobile app would trigger the same actions.
Actual behavior
Posts created via the iOS share extension do not seem to trigger any of the usual post status transitions, and so the related theme functionality is never called.
Steps to reproduce the behavior
I've tried hooking in to:
and none of them seem to work. My current workaround is to publish the post via the app, then edit via wp-admin and change from Published to Draft and then back to Published.
I see a similar question was asked in #4053 but it would be great to get some more clarity here.
Tested on [device], iOS [version], WPiOS [version]
Tested on an iPhone XR using iOS 12.1.2 and WPiOS 11.4.1.
The text was updated successfully, but these errors were encountered: