Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Laurent NAIGEON

Ajax : ajax_single_request

Hi,

It’s possible to call another function after “acp_editing_single_request”?
I want to make another request when i make a modification on line on one specifiq column.

My column is a radio : Yes/No
For exemple, the ajax response is : {"success":true,"data":{"id":"13445","value":"1","display_value":"Yes"}}

I want to get this return in order to make another WP_Query.

Regards

2 years, 4 months ago
Stefan van den Dungen Gronovius
Developer

I’m not really following what you’re trying to accomplish, but do I understand you correctly that you want to do another Ajax Request to do a specific WP_Query?

My first question is, are you able to do your logic in the same Ajax call? If so, you could use the acp/editing/saved hook to do that. (https://github.com/codepress/admin-columns-hooks/blob/master/acp-editing-saved.php).

If you want to do a second Ajax Call, you’ll need to find a way in Javascript to capture the response of the Ajax call and handle it on your own. We fire an event to the document that can be captured by the ACP_InlineEditing_After_Save event.

document.addEventListener('ACP_InlineEditing_After_Save', ( e ) => console.log( e.detail ) );

2 years, 4 months ago
Laurent NAIGEON

Thanks, your first solution is perfect ! ;)

2 years, 4 months ago

You must be logged in to reply to this topic.