BuddyDev

Search

Need help to add custom post field (image type) to BuddyBlog

  • Participant
    Level: Initiated
    Posts: 1
    Mike on #6417

    Hello there,
    First of all I want to thank for this wonderful plugin, for sure it has made our life easier.
    I’m using BuddyBlog and Simple Front End Post plugins, and everything works ok.
    However, there is something that I would like to achieve and I am hoping to get some of your help.

    In the New Post and Edit Posts forms I’m displaying custom fields but I can’t find the way to enable or display an image type (I have textbox, textarea and select types working fine).

    Here is the code I use in bp-custom to display my custom fields

    add_filter('buddyblog_post_form_settings','buddyblog_my_postform_settings');
    function buddyblog_my_postform_settings($settings){
    $settings=array(
    'post_type'=> 'recipes',
    'post_status'=>'publish',//'publish'|'draft' etc
    'custom_fields'=>array(
    'title'=>array(
    'label'=>'Title',
    'required'=>true,
    'type'=>'textbox'),
    'picture'=>array(
    'label'=>'Picture',
    'required'=>true,
    'type'=>'image'), // THIS SHOULD BE AN IMAGE
    'ingredients'=>array(
    'label'=>'Ingredients',
    'required'=>true,
    'type'=>'textarea'),
    'type_recipe'=>array(
    'label'=>'Type',
    'required'=>true,
    'type'=>'select'),
    'preparation'=>array(
    'label'=>'Preparation',
    'required'=>true,
    'type'=>'textarea')
    )
    );

    return $settings;

    }

    I’d deeply appreciate any kind of help on this.

    Best Regards!

  • Participant
    Level: Initiated
    Posts: 1
    Mike on #6426

    Any help? I’m still looking for a way to add an image custom field 🙁

    Thanks!

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #6427

    Hi Mike,
    I am sorry but the BuddyBlog does not implement image custom field type.
    It integrates the Media uploader like in the backend. The Image upload field will need to be either implement as custom field type or you may provide a text box and user can copy//paste the url of the uploaded image like they do in the dashboard.

    Hope that helps.

You must be logged in to reply to this topic.

This topic is: not resolved