-
Notifications
You must be signed in to change notification settings - Fork 3
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
Framework: Ajax module - Remove exit after wp_send_json_success/error #112
Framework: Ajax module - Remove exit after wp_send_json_success/error #112
Conversation
Thanks for the pull request! I see what you mean about OK, I understand, these So I'll merge this. On a related topic, I recently started exploring |
For reference, I'm using a tool called (Originally it was a Git extension using Bash which I wrapped as a standalone NPM package To push new changes to the Framework, I ran: $ npm run subrepo push framework
Subrepo 'framework' pushed to '[email protected]:TangibleInc/framework.git' (main). What I like with this workflow is that its commit history is updated also. So far this tool is working well for managing nested Git repositories, the way I imagine the project organization, the framework and modules. Ideally any module can be turned into a sub-project with a Git repo to develop/test/publish on its own. |
Thank you for merging!
I'm very excited to try that! It looks like I could use a very similar logic to test ajax actions more realistically. I think I'm going to keep the tests as they are for now, as the ajax actions I'm testing are themselves doing requests to a third party api (like here for example), and I'm not sure how I could deal with that I have been very curious about wordpress playground since you created play.tangible.one, and reading the recent thread you started about wordpress studio made me really want to learn more about it! I was thinking that maybe I could try to use it for the fields documentation at some point, as it could be transitioned from being inside the fields-example plugin to just markdown files with iframes for the examples (with the code and a live preview) It would be very cool to be able to edit the code directly from the documentation page and immediately see the results, and it would be close to what you did for play.tangible.one so I could use your work as an example |
Playground has documentation for developers with helpful info on how it works, and how to embed custom WordPress sites. I wrote the page, Host your own Playground, when I was figuring out how to do it. I've been making a few pull requests to contribute/participate, because I find it fascinating, an advanced use case of WebAssembly and overall a great example of how to run an open-source community project. From when I created Now there's a better way, it can start a custom site from a zip file URL. So I've been meaning to refresh the site, and continue developing fun features like shareable snippets. I wrote a library called Base64 Compressor for this purpose, to export a template post and compress it as URL-safe base64 string. In the Loops & Logic docs, a React static site using Docusaurus, I started a Not quite ready yet, but you can see some interesting use of "blueprints" to install the Template System from GitHub, and create a little plugin that overrides the theme to render template posts. It's weird being able to run PHP and automate WordPress with JavaScript in the browser. With I started to write tests for a REST API in the Framework using I'll try to create an "overview" issue for some of these topics, so we can discuss them further - especially about modules in the Framework which are meant to be useful for all our plugins. Please feel free to add if you have any thoughts or questions. |
Hi!
This pull request remove the
exit
afterwp_send_json_success()
andwp_send_json_error()
in the ajax moduleI would like to remove it so that it can be bypassed more easily in tests. Here is the function I'm using to test ajax actions currently (from here):
I initially wanted to replace it with
wp_die()
, but it seems to be already called at the end ofwp_send_json()
when doing ajaxIf it's not possible to remove the exits or if that would make more sense, I can also update the pull request and use
exit
only whenDOING_TANGIBLE_TEST
is not defined, or add our own filter so that it can still be bypassed