• Resolved MULLAINATHAN

    (@vmsmullainathan)


    Hello,
    I have created new custom field called ‘Salary’ using following code,
    function frontend_add_salary_field( $fields ) {
    $fields[‘job’][‘job_salary’] = array(
    ‘label’ => __( ‘Salary’, ‘job_manager’ ),
    ‘type’ => ‘text’,
    ‘required’ => true,
    ‘placeholder’ => ”,
    ‘priority’ => 7
    );
    return $fields;
    }

    Here how can import this salary value to database & fetch it.

    https://www.ads-software.com/plugins/wp-job-manager/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    It will be saved to the DB (post meta) automatically. Retrieve it with https://codex.www.ads-software.com/Function_Reference/get_post_meta

    Thread Starter MULLAINATHAN

    (@vmsmullainathan)

    Thank you,
    Actually I’m new for WordPress. Can you provide proper code for that..?

    Thread Starter MULLAINATHAN

    (@vmsmullainathan)

    In which file I need to add this following code?

    function frontend_add_salary_field_save( $job_id, $values ) {
    update_post_meta( $job_id, ‘_job_salary’, $values[‘job’][‘job_salary’] );
    }add_action( ‘job_manager_update_job_data’, ‘frontend_add_salary_field_save’, 10, 2 );

    Thread Starter MULLAINATHAN

    (@vmsmullainathan)

    Thank you, I found the solution.

    can i have the coding to fetch ‘_job_salary’ value from database.?
    And where to add that coding.?

    Thanks in advance.

    Plugin Author Mike Jolley

    (@mikejolley)

    get_post_meta( $post->ID, '_job_salary', true );

    It would go in the template files most likely.

    Thread Starter MULLAINATHAN

    (@vmsmullainathan)

    Thank You

    Thread Starter MULLAINATHAN

    (@vmsmullainathan)

    Hi,

    Please find my coding.

    <div class=”company”>
    <?php the_company_name( ‘‘, ‘ ‘ ); ?>
    <?php the_company_tagline( ‘<span class=”tagline”>’, ‘</span>’ ); ?>
    <?php get_post_meta( $post->ID, ‘_job_salary’, true ); ?>
    </div>

    I have tried some other options too.

    <?php the__job_salary( ‘<span class=”tagline”>’, ‘</span>’ ); ?>

    But it’s not working. Please assist me to solve this problem.

    Plugin Author Mike Jolley

    (@mikejolley)

    missing an echo before the get_post_meta

    edukart.com/jobs

    1. when we use the short code for signup form, its giving error wat as output.
    2. We need a copy of signup – seperate signup for employee (that would be moderated)
    3. We don’t want to show user with popup form if he is registered, he should get

    Let me know ur email id if admin access is required

    Thread Starter MULLAINATHAN

    (@vmsmullainathan)

    Hi,

    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Import new field value to database’ is closed to new replies.