Forum Replies Created
-
AuthorPosts
-
Nicholas Cox
ParticipantHi Long,
Ok thanks for taking a look, it is a shame it cannot be done as it would have been cool. I will try the other idea instead.
Thanks
Nicholas Cox
ParticipantHi Long,
That is great, thanks!
Nicholas Cox
ParticipantHi
Ok so i have made 2 screen recordings.
I have removed the post_id from the shortcode and tested again with the 'pre_delete_post' filter active, you can see in the video that I receive the PHP database error in the logs.
https://drive.google.com/file/d/1a_p4exzFVSQlibYuhVhRZaYwKDlyjmwf/view?usp=sharingI have also made another screen recording with the 'pre_delete_post' filter removed (commented out). I do not receive any PHP database errors.
https://drive.google.com/file/d/1RNFq7B-q62oa1HPBpLB3kCk2TAeskAjm/view?usp=sharingThanks
Nicholas Cox
Participantthanks
Nicholas Cox
ParticipantHi Long,
good idea, I will give it a test
Thanks
Nicholas Cox
ParticipantHi Long,
I have found the issue, I added the following filter a few days ago; which I can confirm that once removed fixed the database error.
add_filter( 'pre_delete_post', function( $null, $post, $force_delete ) { if( $force_delete == false ) { return wp_trash_post( $post->ID ); } return $null; }, 10, 3 );I added the above code as all my custom post types were being force deleted every time (when set to false) https://support.metabox.io/topic/deleting-custom-post_type-with-frontend-submission-form-permanently-deletes-post/
Any ideas why?
Thanks
Nicholas Cox
ParticipantI found the following actions in another forum post
rwmb_frontend_before_delete & rwmb_frontend_after_delete
how come these are not in the docs?
Nicholas Cox
ParticipantHi Long,
That would be great thanks! really appreciated.
Nick
January 27, 2022 at 4:43 PM in reply to: ✅rwmb-get-object-fields before initialisation of wordpress #33511Nicholas Cox
ParticipantHi Long,
Ok thanks anyway.
Nicholas Cox
ParticipantHi Long,
Ok thanks, just checking before I start developing on this. Well thanks for the example but I am after using custom table meta and not the post ID. But I understand that I will have to grab the column values and then reference the post ID.
Nicholas Cox
ParticipantHi
Ok thanks. Ill take a look
Nicholas Cox
ParticipantAh ok thanks. So in regards to custom models i will still have to check if a database row is available beforehand. I assume ill have to do this via wpdb.
January 19, 2022 at 9:40 PM in reply to: ✅Front End Form and Custom Model - Not Saving Data To Custom Table #33336Nicholas Cox
ParticipantHi
Ah ok I assumed this would have worked the same way as posts with front end submission.
My website users use front end forms only. Do you have a public roadmap for this if it gets added? as my project timeframe is coming to an end.
thanks
January 18, 2022 at 6:58 PM in reply to: rwmb_meta not returning value for users custom table #33310Nicholas Cox
ParticipantHi Long,
Ok so I am running this code inside a class within my own plugin (oop structure). I have just realised this is being called too early? If i wrap this code inside wp_loaded it works. I guess I cant use the helper function then as I need this to run before the page loads. Is there any other option? other than direct wpbd calls?
add_action( 'wp_loaded','test' ); function test() { $value = rwmb_meta( 'city', ['storage_type' => 'custom_table', 'table' => 'wp_dc_users', 'object_type' => 'user'], 3 ); var_dump($value); }I have also tested this inside my theme files and it does load the value correctly.
Nicholas Cox
Participantall metabox plugins and addons have been updated to the latest version and the problem still persists.
-
AuthorPosts