Support » Plugin: WP Job Manager » Editing field priority breaks input

  • Resolved catalin.oanca

    (@catalinoanca)


    Hi,
    I’m having an issue setting the priority of the _job_author field.
    It was working fine in the past but a recent update broke the custom code for me, not sure which one.

    add_filter( 'job_manager_job_listing_data_fields', 'custom_job_manager_job_listing_data_fields', 99 );
    
    function custom_job_manager_job_listing_data_fields( $fields ) {
        $fields['_job_author']['priority'] = '0.13';
        $fields['_featured']['priority'] = '9999';
        return $fields;
    }

    What happens is that the field breaks and instead of this http://prntscr.com/obz1cc it shows this: http://prntscr.com/obz20n
    If I remove $fields['_job_author']['priority'] = '0.13';, it goes back to normal.
    I tried integer values, that didn’t help.

    All other plugins are deactivated and the theme is twentynineteen.

    I hope we can sort this out.
    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi! I asked a developer for assistance with this, and he suggested that you are missing labels:

    function custom_job_manager_job_listing_data_fields( $fields ) {
        $fields['_job_author']['label'] = 'Job Author';
        $fields['_job_author']['priority'] = '0.13';
        $fields['_featured']['priority'] = '9999';
        return $fields;
    }
    add_filter( 'job_manager_job_listing_data_fields', 'custom_job_manager_job_listing_data_fields', 99 );

    Try that!

    Thank you @richardmtl for the suggestion but that only fixes the label issue.
    The field is empty and has no value. Plus, it’s not supposed to be an input field.

    What it shows: http://prntscr.com/ok8vy6
    What is should show: http://prntscr.com/ok8w8c

    Plugin Contributor Richard Archambault

    (@richardmtl)

    I’m marking this thread as Resolved as it’s been more than a month since the last reply. If you still need help, please do reply again and mark the thread as Unresolved!

    Hi @richardmtl ,
    My last reply contained proof that is still not working.

    So I’m still waiting for a solution.

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi!

    Try this instead:

    
    <?php
    
    function custom_job_manager_job_listing_data_fields( $fields ) {
        $fields['_job_author']['label'] = 'Job Author';
        $fields['_job_author']['priority'] = '0.13';
        $fields['_job_author']['type'] = 'author';
        $fields['_featured']['priority'] = '9999';
        return $fields;
    }
    
    add_filter( 'job_manager_job_listing_data_fields', 'custom_job_manager_job_listing_data_fields', 99 );
    

    @richardmtl that worked.
    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.