• Resolved waffeltje

    (@waffeltje)


    Good morning,

    I’ve created some custom meta fields for job listings. One of those fields is a select field, where the user can select one option from a list. These are the functions which I used to add these fields.

    add_filter( 'submit_job_form_fields', 'frontend_add_stageniveau_field' );
    function frontend_add_stageniveau_field( $fields ) {
      $fields['job']['job_stageniveau'] = array(
        'label'       => __( 'Opleiding', 'job_manager' ),
        'type' 		  => 'select',
        'required'    => true,
    	'options' => array('MBO' => 'MBO', 'HBO' => 'HBO', 'Universiteit' => 'Universiteit', 'Anders' => 'Anders'),
        'placeholder' => '',
        'priority'    => 7
      );
      return $fields;
    }
    add_filter( 'job_manager_job_listing_data_fields', 'admin_add_stageniveau_field' );
    function admin_add_stageniveau_field( $fields ) {
      $fields['_job_stageniveau'] = array(
        'label'       => __( 'Opleiding', 'job_manager' ),
        'type'        => 'select',
    	'options' => array('MBO' => 'MBO', 'HBO' => 'HBO', 'Universiteit' => 'Universiteit', 'Anders' => 'Anders'),
        'placeholder' => '',
        'description' => ''
      );
      return $fields;
    }

    After adding these functions the default value of the field ‘job_stageniveau’ is MBO, since this is the first value in the list. How can I make sure that the default value is NULL, but also make sure that it’s not possible for the user to save the form if the value of ‘job_stageniveau’ is still set to NULL.

    Thanks in advance.

    • This topic was modified 3 years ago by waffeltje.
    • This topic was modified 3 years ago by waffeltje.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Jay

    (@bluejay77)

    Hi @waffeltje,

    We do not support customizations – you can refer to our Support Policy:

    https://wpjobmanager.com/support-policy/

    Specifically:

    “We provide our products as-is. We cannot customize our products on-demand, nor can we support third-party customizations. A customization is anything that changes the way the products looks or functions relative to how we make our products available to you. We can do our best to offer advice and guidance, and direct you to the appropriate resources if you require assistance with customization, but we don’t take responsibility or endorse any third-party solutions for customized products.”

    We aren’t able to help with custom code requests like this, so if you need assistance, you may want to look into https://jobs.wordpress.net/.

    Otherwise, you may benefit from using a third-party plugin such as WP Job Manager Field Editor:

    https://plugins.smyl.es/wp-job-manager-field-editor/

    … which has a nice GUI for editing fields. ??

    Please note we do not endorse any 3rd party plugins, and you should reach out to plugin developers for any further questions.

    I hope that helps!

    Thread Starter waffeltje

    (@waffeltje)

    Hi Jay,

    Thanks for your reply!

    I understand that you (as plugin developer) don’t support custom development. I asked the question here in this forum to see whether someone from the WPJM community (/users) might have experience with this question and suggest directions how to achieve the desired functionality.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding a custom meta field with default NULL value which is not selectable’ is closed to new replies.