Forum Replies Created
-
AuthorPosts
-
March 10, 2024 at 8:12 PM in reply to: front end submission for post type does not auto refresh permalinks #44784
Nicholas Cox
Participanthere is the metabox code I'm using to create the posts for a custom post type of 'product'. Is it an issue with custom post types and tables?
$meta_boxes[] = [ 'title' => 'Products', 'post_types' => 'Product', 'storage_type' => 'custom_table', 'table' => $wpdb->prefix . 'dc_products', 'id' => 'dc-product', 'context' => 'normal', 'fields' => [ [ 'type' => 'text', 'name' => 'Title', 'id' => 'post_title', 'class' => 'dc-post-title', 'limit' => 50, //default character length 'required' => true, ], [ 'type' => 'textarea', 'name' => 'Description', 'id' => 'description', 'required' => true, ], [ 'type' => 'number', 'name' => 'Price', 'id' => 'price', 'step' => '.01', //two decimal places e.g. 0.00 'placeholder' => '0.00', 'required' => true, ], [ 'type' => 'number', 'name' => 'Sale Price', 'id' => 'sale_price', 'step' => '.01', //two decimal places e.g. 0.00 'placeholder' => '0.00', 'required' => false, ], [ 'type' => 'select', 'name' => 'Condition', 'id' => 'condition_id', 'options' => (new DripCreateProductCondition())->conditionTypes, 'multiple' => false, 'placeholder' => "", 'select_all_none' => false, 'required' => true, ], [ 'type' => 'text', 'name' => 'SKU', 'id' => 'sku', 'limit' => 10, 'required' => false, ], ], ];March 7, 2024 at 12:22 AM in reply to: front end submission for post type does not auto refresh permalinks #44763Nicholas Cox
ParticipantHi
I dont have any caching enabled on my localhost machine, I have submitted the post using the ajax form and it links to a custom table. Not that it should affect this. I have re-tested quite a few times and it only does it when there is no existing posts in the database (so the first post using the front end form).
I will keep looking to see if i can find out any more information.
Nicholas Cox
ParticipantHi Peter
Ok thanks for letting me know. The reason I am asking is that i use Metabox for development purposes and without logging errors it makes life difficult when problem solving. I spent a few hours figuring out why the forms sometimes kept failing even though the front end forms seemed valid at the time. I know sanitization can help but not all the time.
February 14, 2024 at 8:41 PM in reply to: ✅Custom table field to have same value as post title #44562Nicholas Cox
ParticipantOk thanks i thought i would have to use 'rwmb_after_save_post' but was asking incase there was another way to do this without using 'rwmb_after_save_post'.
Nicholas Cox
ParticipantHi
Any update on this?
Nicholas Cox
ParticipantHi,
thanks for the example, i have resolved my issue, it turns out there was nothing wrong with the code, i was running it too early inside my custom plugin, this returned a empty value, my bad.
sorry to have wasted your time.
Nicholas Cox
ParticipantSo take the following block html block code and output the html.
<!-- wp:meta-box/dc-favourite-button-block {"id":"mb-block-0634ff4f-9fee-4024-a2b6-6c29dd19e46b","data":{"button_text":"\u0026#x2764;","button_text_colour":"#1e73be","button_text_colour_active":"#8224e3","favourite_type":"product","favourite_database_check":1,"default_favourite_value":0}} /-->Nicholas Cox
ParticipantHi, I just want to render the block html on the front end of my site using my theme template using do_blocks()
Nicholas Cox
Participantthanks, just wanted to render out the blocks for a custom app using the rest api.
September 26, 2022 at 10:32 PM in reply to: ✅Custom Table Values - Not Saving To The Custom Tables #38426Nicholas Cox
ParticipantThanks for the update, the latest version now works
Nicholas Cox
Participantgreat thanks Long
September 24, 2022 at 2:32 PM in reply to: ✅Ajax Front End Form Submission - Form Disappears. #38410Nicholas Cox
ParticipantOk thanks. But i was checking if the developers had realised that as its inconsistent and it would mean i will have to go through alot of my existing projects to include wrappers. Would take me a few hours as im using alot of front end forms
September 22, 2022 at 10:06 PM in reply to: ✅Ajax Front End Form Submission - Form Disappears. #38394Nicholas Cox
ParticipantAh ok thanks for clearing this up.
I noticed the rwmb-confirmation message has moved from inside the form wrapper to outside when enabling 'edit=true'. Is there a reason for this? as i was targeting the confirmation messages via CSS using the form ID > child element.
e.g. this is what the confirmation html looks like
<div class="rwmb-confirmation">Updated post successfully</div> <form class="rwmb-form" ........Nicholas Cox
Participantok thanks, i have managed to sort it out with CSS to hide it.
September 9, 2022 at 5:54 AM in reply to: ✅update post_id inside the DOM after the shortcode has rendered #38238Nicholas Cox
Participantok thanks, ill give that a go
-
AuthorPosts