• Resolved math1991

    (@math1991)


    Hi,

    I am using this plugin to add a file input box to the product section in woocommerce but it has stopped working.

    If I go to a product, the incorrect file appears in the meta box and if I change this to the correct one, it still doesn’t change.

    function download_spec_pdf( $meta_boxes ) {
    $prefix = ‘prefix-‘;

    $meta_boxes[] = array(
    ‘id’ => ‘download_spec’,
    ‘title’ => esc_html__( ‘Download Specification PDF’, ‘metabox-online-generator’ ),
    ‘post_types’ => array( ‘product’ ),
    ‘context’ => ‘advanced’,
    ‘priority’ => ‘high’,
    ‘autosave’ => ‘false’,
    ‘fields’ => array(
    array(
    ‘id’ => $prefix . ‘pdf_specification’,
    ‘type’ => ‘file_input’,
    ‘name’ => esc_html__( ‘File Input’, ‘metabox-online-generator’ ),
    ),
    ),
    );

    return $meta_boxes;
    }
    add_filter( ‘rwmb_meta_boxes’, ‘download_spec_pdf’ );

    This is the code I am using.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter math1991

    (@math1991)

    It works on some products fine but others it doesn’t. I have checked the database and they are correct for each product but do not show correctly in the wordpress admin section.

    When I go to edit a product, the file path is different compared to the correct one (which is also correct in the database). When I try to update this to the correct one, when I click update on the product page, it goes back to the incorrect path.

    Thanks

    Plugin Author Anh Tran

    (@rilwis)

    Hi @math1991,

    Can you check if you have another code that use the same field ID? Or some code that filter the field value. That’s the only reason I can think of.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘File meta box not updating’ is closed to new replies.