WP Job Manager Field Editor Shortcodes

Shortcodes

Right now you can use either job_field, resume_field, custom_field, or company_field and it will output same data. Separate shortcodes are for future enhancements.

If you want the shortcode to ONLY output the value (without any HTML or other wrappers), set the output_as argument to value:

[custom_field key="my_meta_key" output_as="value"]

Below is a list of arguments supported for the shortcodes.  If the option/argument is only used by a specific output as type it will say (TYPE output as):

  • key  (required) – The meta key for the field you want to output.
  • field (required) – Same as key above, you must use either field or key to specify the meta key. Only one (key or field) is required.
  • listing_id  (optional) – If you want to output the value from a field for a specific Job or Resume ID, use this argument, otherwise leave blank and it will use the ID from the current page you have the shortcode on.
  • output_as  (default is null and outputs as standard text) – One of the available output as options
    current options are value, oembed, video, link, image, checklabel, checkcustom, gallery
  • output_classes  – Any extra classes you want added to the field output HTML
  • output_show_label – ( value should be 1 for true, or 0 for false) – Whether or not to show the label for the field.
  • label  – Set this to any custom value if you want to use a custom label (different from configuration for field)
  • multiple  – Set this to 1 or true if you are outputting a field that is either a taxonomy, or is multiple file uploads (not required for Field Editor >= 1.3.6)
  • taxonomy  – If you are trying to output a taxonomy you may need to set this argument with the taxonomy slug (ie job category is job_listing_category)
  • li  – Set this to true or 1 if you want to output a multiple item field in <li> tags instead of comma separated values
  • image_link  – Set this to true or 1 if you want to wrap an image in a link to the full URL of the image (only for image output_as type)
  • output_oembed_width  (oembed output as) – Set a specific width for oEmbed outputs
  • output_oembed_height  (oembed output as) – Set a specific height for oEmbed outputs
  • output_video_width  (video output as) – Set a specific width for HTML5 video output
  • output_video_height  (video output as) – Set a specific height for HTML5 video output
  • output_video_poster  (video output as) – Set a specific image to be placeholder on HTML5 video output (must be a full URL to image)
  • output_video_allowdl  (video output as) – Set this to 1 or true if you want to allow users to download the video if their browser does not support HTML5 video
  • output_caption  (link output as) – Caption used for link
  • output_check_true  (checkcustom output as) – Caption used if checkbox was checked
  • output_check_false  (checkcustom output as) – Caption used if checkbox was not checked
  • output_enable_fw  Whether or not to output HTML wrappers around full output
  • output_enable_vw  Whether or not to output HTML wrappers around each value
  • output_full_wrap  HTML entity to use for full wrapper output (should be value without carets, example would be div)
  • output_value_wrap HTML entity to use for value wrapper output (should be value without carets, example would be div)
  • output_label_wrap HTML entity to use for label wrapper output (should be value without carets, example would be div)
  • fw_classes Any classes to add to the full wrap HTML element (should be separated by spaces)
  • inherit_config set to TRUE or 1 if you want the shortcode output to inherit any configuration from the auto output settings.  You can override specific settings by just setting them in the shortcode arguments as well.
  • prepend_value  Any string value you want to prepend (put in front) of actual value, that is only output when there is a value
  • append_value  Any string value you want to append (put at end) of actual value, that is only output when there is a value
  • output_csv  Pass true (or 1) to output a multi-value field using Comma Separated Values (instead of default <br /> tag)
  • wp_list_categories  Pass true (or 1) to output a multi-value field using WordPress’ built in wp_list_categories function, that will wrap each item in a <ul> and <li> format ( requires Field Editor >= 1.9.1 )

You can also check the /wp-content/plugins/wp-job-manager-field-editor/includes/functions.php file around line 308 (function is called the_custom_field_output_as ) and any arguments supported in that function can be passed through the shortcode.

You can also use PHP Functions to output the custom field values.

Conditional Shortcodes

See a full tutorial, with examples, here: https://plugins.smyl.es/docs-kb/field-editor-conditional-shortcodes/

Standard Syntax

[if_custom_field key="field_meta_key"]
    You will see this text when the field has a value, which is: [job_field key="field_meta_key"]
[else]
    You will see this text, when field_meta_key does NOT have a value!
[/if_custom_field]

Conditional Shortcodes Attributes

  • equals  – value to check against value on listing
    single value fields – checks if the the value from the listing, matches exactly the value that was passed
    multiple value fields/taxonomies – checks if the ONLY value selected equals the value passed.  In regards to multiple value fields, think of this as “ONLY equals
  • contains  – value to check for anywhere in the value on the listing
    single value fields – checks if anywhere in the value on the listing, the value passed exists
    multiple value fields/taxonomies – checks if ANY of the values match the value passed (this will be most common one used for taxonomies)

Both attributes/arguments are optional, and if neither are passed, any value (other than an empty one) on the listing will result in the check returning true

Advanced Syntax

[if_custom_field key="field_meta_key" equals="yes"]
    You will see this text when the field has a value that exactly equals "yes"
[else]
    You will see this text, when field_meta_key does NOT match "yes"
[/if_custom_field]
[if_custom_field key="field_meta_key" contains="yes"]
    You will see this text when the field has a value that contains "yes" anywhere in it.
    You can even output that field: [custom_field key="field_meta_key"]
[else]
    You will see this text, when field_meta_key does NOT contain "yes" anywhere in the value
[/if_custom_field]

See a full tutorial (with examples of using conditional attributes) here: https://plugins.smyl.es/docs-kb/field-editor-conditional-shortcodes/

Job Field Shortcode

[job_field key="field_meta_key" job_id="111"]

key is required job_id optional

Company Field Shortcode

[company_field key="field_meta_key" job_id="111"]

key is required job_id optional

Resume Field Shortcode

[resume_field key="field_meta_key" job_id="111"]

key is required job_id optional

Custom Field Shortcode

[custom_field key="field_meta_key" job_id="111"]

Custom field shortcode can be used for any fields, but it is recommended to use the shortcode specific to the field you are outputting (if for job, use job_field shortcode) to support any new features and updates.  At this time though, all shortcodes do exactly the same thing and you can use any of them to output fields with the same results.

key is required job_id optional

Each Shortcode

You can find documentation on the [each_custom_field] shortcode at the link below (requires Field Editor >= 1.9.1):

https://plugins.smyl.es/docs-kb/each-shortcode-for-field-editor/

Total 19 Votes

Tell us how can we improve this post?

+ = Verify Human or Spambot ?