Forum Replies Created
-
AuthorPosts
-
Nicholas Cox
Participantthanks! worked for me
Nicholas Cox
ParticipantHi
Ok thanks for the links, it worked perfectly.
Nick
Nicholas Cox
Participantok thanks, I will use this then https://docs.metabox.io/extensions/mb-frontend-submission/#form-actions
Nicholas Cox
Participantok thanks, I will use the WPDB class then.
Nicholas Cox
ParticipantHi
Thanks for the quick response. You are right, thanks for this, I assumed as I was not calling the post content and just the title, that in theory, it would not load all the CSS/JS.
This has now been resolved.
Thanks
Nick
Nicholas Cox
ParticipantJust an update, I was up late last night and forgot that I had a script in my footer.php page which was being called (I left in in there as I was doing a test). This is the bit of code causing all of those CSS/JS to be loaded, but not sure why?
$request = WP_REST_Request::from_url( 'http://localhost/freestuffgroup/wp-json/wp/v2/posts' ); $request->set_method( 'GET' ); $response = rest_do_request( $request ); $jsonStr = json_encode($response->get_data()); //var_dump( $jsonStr );Thanks
Nick
Nicholas Cox
ParticipantHi
Sorry it is was clear before I uploaded it. Here is a new image of the inspector tab. You can see all I am calling is one metabox block and nothing else.
Also I have no other plugins installed, just my own plugin (Drip Create Plugin). If I remove the metabox block all of the JS/CSS are no longer called. I have created a test page with only one metabox block and no other information, see below.
Thanks
Nick
Nicholas Cox
ParticipantHi
I am not looking to upload the images to WordPress. But to send the base64 data to a 3rd party API after the user submits the form. So I just need to be able to execute a custom function of my own on form submission. Is this possible?
- User fills in the form
- User uploads images which are read by the filereader (FileReader.readAsDataURL())
- User Submits the form
3a. Execute a function to send all base64 strings to an API
sorry I was not very clear before. Hope the above helps?
Thanks
Nicholas Cox
ParticipantHi
Thanks for the information. I have managed to get the sanitize callback working. There is just one more thing I need to do.
I need to be able to upload the images to a custom folder when the user submits the form. Is there a hook or callback I can use to initiate before sanitization?
Thanks
Nick
Nicholas Cox
ParticipantHi, I noticed the Trello card has now been marked as complete. When is the next release of updates which includes this? https://trello.com/c/82y4SLve/10-custom-table-create-content-table
thanks
Nicholas Cox
Participantgreat thanks, I'll check out the link.
Nicholas Cox
Participantthanks for the link, very useful.
Nicholas Cox
ParticipantAlso I have been checking out using custom API endpoints and using them for search and filter posts. I know Metabox adds fields into the API as I have the addon installed. What are your thoughts on using the wordpress rest api over admin-ajax.php?
Nicholas Cox
Participantforgot to mention, how to I pass the value e.g. file1.jpg to sanitize it before saving the value to the database?
Nicholas Cox
ParticipantHi
- thanks for confirming.
-
I'm not exactly sure what you mean, how to I get Metabox to save the input field value? e.g. file1.jpg, file2.jpg, file3.jpg?
Thanks
Nick
-
AuthorPosts

