• Resolved dharry

    (@dharry)


    I am calling some custom code in the job_manager_job_submitted_content_after action and am trying to find a list of $job variables that I can use in that code.

    For example, if I am trying to construct an email saying “A new job has been posted here: <<url>> for the company <<company>> which is required on <<required date>>”

    How can I find all the variable names for the values I want to insert?

    Thanks
    Dean

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter dharry

    (@dharry)

    ok, I figured out the $job fields but can’t seem to get the company fields:

    $company = get_post_meta( $job->ID )[‘_user_company_name’][0]; – This doesn’t work
    $location = get_post_meta( $job->ID )[‘_job_location’][0]; – This does work

    and yes, I check the meta name on the Company field and it is definitely correct.

    Dean

    Thread Starter dharry

    (@dharry)

    also, how do I get the job URL after job submission?

    Hi there!

    We have a few helper functions located in wp-job-manager-template.php that might be useful. For example, you can get the company name from get_the_company_name( $job ). Additionally, you should be able to retrieve the company name from the _company_name post meta for the job. You can see more of these fields here.

    You can get the URL for the job by calling get_permalink( $job ). However, unless you have disabled moderation (admin has to go in and approve the job listing), that link won’t work immediately after the job has been submitted.

    Jake M.

    Thread Starter dharry

    (@dharry)

    Thanks Jake, that’s awesome…

    Cheers
    Dean

    • This reply was modified 5 years, 10 months ago by dharry.
    Thread Starter dharry

    (@dharry)

    Hi Jake,

    I am trying to get the category name from the array returned with wpjm_get_the_job_categories but having trouble getting just the name, the array is returning fine for the job as per:

    Array ([0] => Array([0] => WP_Term Object([term_id] => 95[name] => Certificate III[slug] => certificate-iii[term_group] => 0[term_taxonomy_id] => 95[taxonomy] => job_listing_category[description] => Certificate III in Child Care[parent] => 0[count] => 1[filter] => raw)) )

    I tried $cert = array_column($certification, ‘name’) but that didn’t seem to work… my php skills are not the best, would appreciate a pointer?

    Thanks
    Dean

    Thread Starter dharry

    (@dharry)

    Hi Jake, not to worry, all sorted now ??

    Thanks anyway.

    Regards,
    Dean

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fields after Job Submission’ is closed to new replies.