Support » Plugin: Front-end Editor » [Plugin: Front-end Editor] add post_meta type checkbox

  • Hi!

    I tryed to add a checkbox for post_meta. My code:

    <?php editable_post_meta( get_the_ID(), 'drift', array(
    	'type' => 'checkbox',
    	'values' => array(
    	    'val_1' => 'Bensin',
    	    'val_2' => 'Diesel',
    	    'val_3' => 'Elektrisk',
    	    'val_4' => 'Batteri'
    )  ); ?>

    But it doesn´t work and the wiki doesnt show up a exemple. What did wrong?

    Thanks for help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Cyril



    Same problem here with FEE 2.1.1. With the code above, i got a JS error :

    invalid field type <span class="fee-field" title="Champs personnalisés" data-filter="post_meta" data-i="0" data-key="my-meta-key" data-post_id="270" data-values="{"1":"yes","0":"no"}" data-type="checkbox">

    Looking in build/editor.js, it seems that the declaration of checkobx data-type is missing. There should be something like this : FrontEndEditor.fieldTypes.checkbox = checkbox = (function(_super){...})


    Plugin Author scribu


    The reason the ‘checkbox’ (and ‘radio’) type is missing is because, unlike the dropdown or the text input, it would take up a lot of room, potentially messing up the layout of the page.



    Hmm, ok for your answer. So checkbox type is voluntary missing from JS file. But i don’t understand the way to use the code in the first post of Markus ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Front-end Editor] add post_meta type checkbox’ is closed to new replies.