Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 106 through 120 (of 221 total)
  • Author
    Posts
  • Nicholas CoxNicholas Cox
    Participant

    here 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,
    		],
    	],
    ];
    Nicholas CoxNicholas Cox
    Participant

    Hi

    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.

    in reply to: Invalid strings and API::add callback Issue #44647
    Nicholas CoxNicholas Cox
    Participant

    Hi 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.

    in reply to: Custom table field to have same value as post title #44562
    Nicholas CoxNicholas Cox
    Participant

    Ok 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'.

    in reply to: Front End Submission and Custom Models #44191
    Nicholas CoxNicholas Cox
    Participant

    Hi

    Any update on this?

    in reply to: do_blocks and missing inner html content #41341
    Nicholas CoxNicholas Cox
    Participant

    Hi,

    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.

    in reply to: do_blocks and missing inner html content #41301
    Nicholas CoxNicholas Cox
    Participant

    So 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}} /-->
    
    in reply to: do_blocks and missing inner html content #41300
    Nicholas CoxNicholas Cox
    Participant

    Hi, I just want to render the block html on the front end of my site using my theme template using do_blocks()

    in reply to: do_blocks and missing inner html content #41297
    Nicholas CoxNicholas Cox
    Participant

    thanks, just wanted to render out the blocks for a custom app using the rest api.

    in reply to: Custom Table Values - Not Saving To The Custom Tables #38426
    Nicholas CoxNicholas Cox
    Participant

    Thanks for the update, the latest version now works

    in reply to: Add Foreign Key to Custom Table/Model #38425
    Nicholas CoxNicholas Cox
    Participant

    great thanks Long

    in reply to: Ajax Front End Form Submission - Form Disappears. #38410
    Nicholas CoxNicholas Cox
    Participant

    Ok 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

    in reply to: Ajax Front End Form Submission - Form Disappears. #38394
    Nicholas CoxNicholas Cox
    Participant

    Ah 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" ........
    in reply to: Embed form inside iframe externally #38239
    Nicholas CoxNicholas Cox
    Participant

    ok thanks, i have managed to sort it out with CSS to hide it.

    Nicholas CoxNicholas Cox
    Participant

    ok thanks, ill give that a go

Viewing 15 posts - 106 through 120 (of 221 total)