WordPress.org

Ready to get started?Download WordPress

Forums

Developer's Custom Fields
Upload file not saving (2 posts)

  1. Dinesh Kesarwani
    Member
    Posted 2 years ago #

    I am using Developer's Custom Field with custom post to set before-after images. Herewith listed my code. But when i select image and update the post. But, it is nat saving the uploaded images. And, displaying blank.

    function register_my_custom_fields() {
    	slt_cf_register_box( array(
    		'type'		=> 'post',
    		'title'		=> 'Before After images',
    		'id'		=> 'before-after-images',
    		'context'	=> 'normal',
    		'priority'	=> 'high',
    		'fields'	=> array(
    			array(
    				'name'			=> 'before_image',
    				'label'			=> 'Before Image',
    				'type'			=> 'file',
    				'scope'			=> array( 'beforeafter' ),
    				'capabilities'	=> array( 'edit_posts' ),
    				'preview_size'	=> 'thumbnail',
    				'file_button_label'	=> 'Select Before Image',
    			),
    			array(
    				'name'			=> 'after_image',
    				'label'			=> 'After Image',
    				'type'			=> 'file',
    				'scope'			=> array( 'beforeafter' ),
    				'capabilities'	=> array( 'edit_posts' ),
    				'preview_size'	=> 'thumbnail',
    				'file_button_label'	=> 'Select After Image',
    			)
    		)
    	));
    }

    any solutions????

    http://wordpress.org/extend/plugins/developers-custom-fields/

  2. Steve Taylor
    Member
    Plugin Author

    Posted 2 years ago #

    Could you clarify, is beforeafter a custom post type?

    I can't see any obvious problem with the above code. If you set WP_DEBUG to true in wp-config.php, do you see any errors?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic