• Resolved nghtmre

    (@nghtmre)


    Hello,

    Is it possible to overload this file?
    ‘class-wp-job-manager-post-types.php’

    Let me explain, I wanted to create an additional field of the same type as the ‘_job_expires’ field

    I managed to create a text field via the code below

    add_filter( 'job_manager_job_listing_data_fields', 'admin_add_relance_field' );
    function admin_add_relance_field( $fields ) {
      $fields['_relance'] = array(
        'label'       => __( 'Date de relance', 'job_manager' ),
        'type'        => 'text',
        'placeholder' => '00/00/0000',
        'required'    => false,
        'description' => '',
        'priority'    => 13,
      );
      return $fields;
    }

    unfortunately I would like to have a calendar in the same way as ‘_job_expires’
    So I hack something (French expression) in the file ‘class-wp-job-manager-post-types.php’ but I would like the overloaded so that it is not deleted during a possible update.

    If someone has another solution or another idea, I take it.

    thank you in advance

    cordially

    • This topic was modified 4 years, 11 months ago by nghtmre.
Viewing 1 replies (of 1 total)
  • Thread Starter nghtmre

    (@nghtmre)

    Hello,

    Just to let you know that I found the solution.

    Here is the code I inserted in the function.php file.

    add_filter( 'job_manager_job_listing_data_fields', 'admin_add_relance_field' );
    function admin_add_relance_field( $fields ) {
      $fields['_relance'] = array(
        'label'       => __( 'Date de la relance', 'job_manager' ),
        'type'        => 'text',
        'placeholder' => '',
        'show_in_admin' => true,
        'show_in_rest' => true,
        'data_type'   => 'string',
        'required'    => false,
        'description' => '',
        'priority'    => 13,
        'classes'     => 'job-manager-datepicker',
      );
      return $fields;
    }

    If that can help you.

Viewing 1 replies (of 1 total)
  • The topic ‘Calendar custom field’ is closed to new replies.