Error message: Cannot redeclare custom_submit_job_form_fields()
-
Good morning,
I’m using the plugin Code Snippets to add custom fields to job_listings. Now, I’m receiving the following php error:
Error message: Cannot redeclare custom_submit_job_form_fields() (previously declared in /var/www/vhosts/xxx/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()’d code:6)
There is a conflict between WP Job Manager and the snippet I added (I’ve added numerous custom job fields using snippets and they used to work fine).
I’m adding custom fields using the two follOwing snippets:
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; }
add_filter( 'job_manager_job_listing_data_fields', 'admin_add_startdatum_field' ); function admin_add_startdatum_field( $fields ) { $fields['_job_startdatum'] = array( 'label' => __( 'Startdatum', 'job_manager' ), 'type' => 'select', 'options' => array('Z.s.m.' => 'Z.s.m.', 'Flexibel' => 'Flexibel', 'Z.s.m. & flexibel' => 'Z.s.m. & Flexibel', 'Oktober 2020' => 'Oktober 2020', 'November 2020' => 'November 2020', 'December 2020' => 'December 2020', 'Januari 2021' => 'Januari 2021', 'Februari 2021' => 'Februari 2021', 'Maart 2021' => 'Maart 2021', 'April 2021' => 'April 2021', 'Mei 2021' => 'Mei 2021', 'Juni 2021' => 'Juni 2021', 'Juli 2021' => 'Juli 2021', 'Augustus 2021' => 'Augustus 2021', 'September 2021' => 'September 2021'), 'placeholder' => '', 'description' => '' ); return $fields; }
Any suggestions how to resolve this error? The error seems to be around the WP Job Manager hook custom_submit_job_form_fields() (https://wpjobmanager.com/document/editing-job-submission-fields/).
Thanks in advance.
Bèrke
- The topic ‘Error message: Cannot redeclare custom_submit_job_form_fields()’ is closed to new replies.