Skip to content

Instantly share code, notes, and snippets.

View matadorjobs's full-sized avatar

Matador Jobs matadorjobs

View GitHub Profile
@matadorjobs
matadorjobs / require_resume_submission_at_processing_level.php
Created May 2, 2023 17:54
Matador Docs Example: Require Resume Submission at Processing Level
<?php // omit opening PHP tag
add_filter( 'matador_application_data_raw', 'matador_docs_require_resume_submission_at_processing_level', 20 );
/**
* Matador Docs Example: Require Resume Submission at Processing Level
*
* In the event spam bots have found a way to bypass your resume requirement, this is an added layer of validation to
* stop the spam from sneaking through. This will have a poor User Interface in the event you use this on forms where
* a resume is optional and this is a site-wide "hammer" solution, so all applications must require resume if you intend
* to use this. Further, this will break the "Matador Jobs Pro - Contact Form Extension" if you use it.
*
@matadorjobs
matadorjobs / matador_docs_taxonomy_terms_term_label.php
Last active August 11, 2023 14:39
Display count of jobs per term in a Matador taxonomy term list
<?php //omit opening tag
add_filter( 'matador_taxonomy_terms_term_label', 'matador_docs_matador_taxonomy_terms_term_label', 10, 2 );
/**
* Matador Docs Example: Add Term Count to Taxonomy Term Label
*
* In this example, display count of jobs per term in a Matador taxonomy term list.
*
* @since 2023-05-01
*
@matadorjobs
matadorjobs / matador_docs_theme_button_classes.php
Created May 2, 2023 01:26
Assuming our theme has previously defined classes for buttons of 'button', 'button-secondary', and 'button-alternate', give those CSS classes to Matador Buttons so to adopt theme CSS conventions.
<?php //omit opening tag
add_filter( 'matador_template_button_classes', 'matador_docs_theme_button_classes', 10, 2 );
/**
* Matador Docs Example: Theme Button Classes
*
* Assuming our theme has previously defined classes for buttons of 'button', 'button-secondary', and 'button-alternate', give those CSS classes to Matador Buttons so to adopt theme CSS conventions.
*
* @since 2023-05-01
*
// replace the standard values of "Submitted" or "new Lead"
add_filter( 'matador_data_source_status', function(){
return 'Candidate';
} );
/**
* Matador Data Status Description
*
@matadorjobs
matadorjobs / matador_data_source_description_1.php
Last active October 6, 2022 20:44
matador_data_source_description hook usage examples
<?php
namespace matador_docs;
add_filter( 'matador_data_source_description', 'matador_docs\matador_data_source_description_1', 10, 4 );
/**
* Matador Data Source Description Hook Usage Example 1
*
* Change from "{Site Name} Website" to "Corporate Site".
*
* @see https://docs.matadorjobs.com/articles/matador_data_source_description/
@matadorjobs
matadorjobs / example_matador_template_the_job_meta.php
Last active May 13, 2022 07:34
Modify Job Meta Fields Before Presentation
// If using matador_the_job_meta(), matador_get_the_job_meta(), or the [matador_job_field name="field"] shortcode,
// filter the output on its way out to your template using one of the following filters.
/**
* Dynamic Filter: Matador Template The Job Meta
*
* @since 3.4.0
*
* @param string $meta Meta value.
* @param int $id ID of job.
@matadorjobs
matadorjobs / snippet_change_state_to_US_states_dropdown.php
Created February 22, 2021 19:06
Change the state/province application form field to a drop-down of US states and territories.
<?php // omit opening PHP tag
add_filter( 'matador_application_fields_structure', 'mdocs_change_state_field_to_US_states_dropdown', 50, 1 );
/**
* Matador Change "State" to US States Dropdown
*
* Change the state/province application form field to a drop-down (<select>) of US states and territories.
*
* @since 2021-02-22
*
* @param array $fields Array of Form Fields
@matadorjobs
matadorjobs / matador_template_button_classes.php
Created July 13, 2020 17:01
Apply template class names to Matador Buttons
<?php // omit opening PHP tag
add_filter( 'matador_template_button_classes', 'mdocs_matador_template_button_classes', 10, 2 );
/**
* Matador Template Button Classes Example Filter
*
* @since 2020-07-12
*
* @param string $classes Space-separated string of classes for a button
* @param string $context Button context, for filtering purposes, either 'primary', 'secondary', or 'tertiary'
*
@matadorjobs
matadorjobs / tutorial_matador_custom_location_data_step_2.php
Last active April 1, 2020 21:31
Matador Docs Tutorial: Importing & Using Custom Location Data
<?php // Omit opening PHP tag
add_filter( 'matador_bullhorn_import_fields', 'mdocs_tutorial_custom_location_data_step_2' );
/**
* Matador Docs Tutorial: Custom Location Data Step 2 - Importing the Field
*
* Example below imports Bullhorn field named 'customText1', calls it 'location_area', declares it a 'string', and declares
* as a custom field type.
*
* @since 2020-03-30
@matadorjobs
matadorjobs / example_matador_import_location_taxonomy_field.php
Last active March 30, 2020 19:23
Matador Docs Example: Modify Job General Location Taxonomy Source
<?php //omit opening PHP tag
add_filter( 'matador_import_location_taxonomy_field', 'mdocs_example_matador_import_location_taxonomy_field', 10 );
/**
* Example Location Taxonomy Field
*
* @copyright 2020, Matador Software, LLC
* @author Jeremy Scott, Matador Software LLC
* @link https://matadorjobs.com/
*
* @param string $field_to_use