keybase.md### Keybase proof I hereby claim: * I am tripflex on github. * I am tripflex (https://keybase.io/tripflex) on keybase. * I have a public key whose fingerprint is 04F0 8E39 26DF EE4F 9925 F352 443D 9353 7751 1C37 To claim this, I am signing this object: “`json { "body": { "key": { "eldest_kid": "0101b520f2274b600561561243b5e5d1ac2a1c2445d922d2a1340ff595890dab31640a", "fingerprint": […]
FacetWP support for WP Job Manager serialized fields (not needed if using Field Editor 1.4.7 or newer)
functions.php<?php add_filter( ‘facetwp_indexer_post_facet’, ‘fwp_index_wpjmfe_serialized’, 15, 2 ); /** * Filter FacetWP indexing to index WP Job Manager fields * * Some WP Job Manager fields are saved as serialized arrays, and due to this, we need to * make sure and unserialize that data to make it indexable. This will also index normal * WP […]
Get custom field configuration data (to get label, description, or other field configuration)
functions.php<?php /** * This is for backwards compatibility with Field Editor 1.4.6 or older, any version 1.4.7 and newer * will already have this function built-in, probably with some type of caching as well. * * If you decide to add this to your site, make sure to remove it later on if you upgrade […]
WordPress Recursively get taxonomy hierarchy (courtesy of http://www.daggerhart.com/wordpress-get-taxonomy-hierarchy-including-children/ )
functions.php<?php /** * Recursively get taxonomy hierarchy * * @source http://www.daggerhart.com/wordpress-get-taxonomy-hierarchy-including-children/ * @param string $taxonomy * @param int $parent – parent term id * * @return array */ function get_taxonomy_hierarchy( $taxonomy, $parent = 0 ) { // only 1 taxonomy $taxonomy = is_array( $taxonomy ) ? array_shift( $taxonomy ) : $taxonomy; // get all direct […]
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
functions.php<?php /** * Remove Class Filter Without Access to Class Object * * In order to use the core WordPress remove_filter() on a filter added with the callback * to a class, you either have to have access to that class object, or it has to be a call * to a static method. This […]
Set a field as Read Only using jQuery
functions.php<?php add_action( ‘submit_job_form_start’, ‘my_custom_jquery_set_field_readonly’ ); function my_custom_jquery_set_field_readonly(){ /** * Replace FIELD_META_KEY with the meta key of the field you want to set as readonly. * If you want to set it as disabled instead, just change ‘readonly’ to ‘disabled’ */ echo "<script>jQuery(function($){ $(‘#FIELD_META_KEY’).prop(‘readonly’, true); });</script>"; }
Prepend a custom value on a URL for specific WP Job Manager fields (only works with single values, not array values)
functions.php<?php add_filter( ‘get_post_metadata’, ‘my_custom_url_prepend_value’, 99999, 4 ); /** * Get Meta Filter * * Filter the get_metadata function to return specific value we * customize. * * Null should be returned to allow get_metadata to proceed and * actually get the meta. If anything other than null is returned * that is what will be […]
array_insert function, insert array into another array before/after a certain key
functions.php<?php if( ! function_exists( ‘array_insert’ ) ) { /** * Insert an array into another array before/after a certain key * * @param array $array The initial array * @param array $pairs The array to insert * @param string $key The certain key * @param string $position Wether to insert the array before or after […]
Add a custom field to the WP Job Manager Job Listings Admin List Table (unsortable)
functions.php<?php //ONLY ADD COLUMN AND CONTENT TO CUSTOM JOB LISTINGS POSTS add_filter(‘manage_job_listing_posts_columns’, ‘xyz123_my_custom_job_listing_columns’); add_action(‘manage_job_listing_posts_custom_column’, ‘xyz123_my_custom_job_listing_column_value’, 10, 2); // ADD COLUMN TO LIST TABLE function xyz123_my_custom_job_listing_columns($defaults) { $defaults[‘job_metakey’] = ‘LabelHere’; return $defaults; } // OUTPUT VALUE IN COLUMN LIST TABLE function xyz123_my_custom_job_listing_column_value($column_name, $post_ID) { // Check if $column_name matches the meta key you want to output […]
Set field configuration through PHP for WP Job Manager with WP Job Manager Field Editor 1.4.2+ (example is for setting options)
functions.php<?php /** * Filter for fields before filtering based on $filter value * * Filter syntax is `job_manager_field_editor_get_fields_pre_filter_{$field_group}` … replace {$field_group} with field group * * Job Fields: job_manager_field_editor_get_fields_pre_filter_job * Company Fields: job_manager_field_editor_get_fields_pre_filter_company * Resume Fields: job_manager_field_editor_get_fields_pre_filter_resume_fields * * @param array $fields All fields in array structured format, similar to * ‘meta_key’ => array( ‘label’ […]