Skip to content

Instantly share code, notes, and snippets.

View jeremyescott's full-sized avatar

Jeremy Scott jeremyescott

View GitHub Profile
@jeremyescott
jeremyescott / matador_application_confirmation_candidate_from_filter.php
Created December 4, 2018 17:17
Matador Application Confirmation Candidate From
<?php
/**
* Filter: Matador Application Confirmation Candidate From
*
* Modify the "From" name and email address for the Application Confirmation for Candidates email.
*
* @var string $from
* @var array $data
*/
@jeremyescott
jeremyescott / custom_matador_scheduled_event_recurrence__all.php
Last active September 17, 2018 17:32
Change the frequency of the Matador Scheduled Event / WP Cron task.
/**
* Customize Matador: Set Recurrence of Scheduled Events
*
* This function sets the recurrence of the Matador WP Cron from 'hourly'
* to the returned value. Warning: returned value must exist in the WordPress
* schedules array. Default values in the WP Schedules Array are 'hourly',
* 'twicedaily', and 'daily'. Example function uses a non-standard schedule,
* which will need to be registered in a separate function. Also, Matador Software
* provides this method as-is and will not support sites that run schedules at fewer
* than once per hour. Running more regularly will risk exceeding daily rate limits
@jeremyescott
jeremyescott / matador_rewrites_taxonomy_has_front.php
Last active July 1, 2018 23:08
Remove the job slug from the URL for job taxonomy archives
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//*
//* The Matador Team recommends you add this to a 'must-use' plugin.
//* See: https://matadorjobs.com/docs/developer/where-to-put-matador-modifications-code/
/**
* Remove the job slug from the url for job taxonomy archives
* Changes 'yoursite.com/jobs/categories' to 'yoursite.com/categories'
* Use the 'URL Slugs' section of the 'Jobs' tab in Matador settings to change the job or taxonomy slug.
@jeremyescott
jeremyescott / matador_tutorial_application_fields_labels_and_placeholder.php
Created February 5, 2018 20:03
Change Label or Add a Placeholder to Matador Application Fields
function matador_tutorial_application_fields( $fields ) {
$fields['firstName']['label'] = 'Label Name'; // changes the label
$fields['firstName']['attributes']['placeholder'] = 'Placeholder Content'; // Adds a placeholder
return $fields;
}
add_filter( 'matador_application_fields_structure', 'matador_tutorial_application_fields' );
@jeremyescott
jeremyescott / matador_displaying_job_fields.php
Last active January 26, 2018 20:54
3 ways to display job fields in Matador
<?php
// Shortcode in the WordPress Editor or a Page Builder
// name: the name of the field
// id: (optional) the ID of the job, if you're outside the loop
// before: (optional) arbitrary HTML before the field.
// after: (optional) arbitrary HTML after the field.
[matador_job_field name="employmentType" id="XX" before="some-html" after="some-html"]
// Matador Field Template Helper
@jeremyescott
jeremyescott / matador_bullhorn_import_fields.php
Last active January 25, 2018 15:24
matador_bullhorn_import_fields.php
// Add to functions.php or a file included in your theme.
function mdocs_matador_bullhorn_import_fields( $fields ) {
$fields = array(
'correlatedCustomTextBlock1' => array(
'type' => 'string',
'saveas' => 'meta',
'name' => 'field_name', // optional, what the field will be named in WP, defaults to array key
),
);
return $fields;
@jeremyescott
jeremyescott / matador_locate_template_override.php
Created December 1, 2017 22:01
Matador Locate Template Filter Example
/**
* Override Matador Locate Template
*
* Overrides Matador's job-single-append-apply-now.php template with a same-named file in the theme's
* matador-overrides folder.
*/
add_filter( 'matador_locate_template', 'matador_locate_template_override_job-single-append-apply-now', 10, 2 );
function matador_locate_template_override_job-single-append-apply-now( $template, $name ) {
if ( 'job-single-append-apply-now' === $name ) {
return get_stylesheet_dir() . '/includes/matador-overrides/job-single-append-apply-now.php';
@jeremyescott
jeremyescott / matador_import_location_taxonomy_field_set_state.php
Created November 29, 2017 19:25
Change the location field that sets the locations taxonomy.
/**
* Matador Location Taxonomy as "State"
*/
add_filter( 'matador_import_location_taxonomy_field', 'matador_import_location_taxonomy_field_set_state' );
function matador_import_location_taxonomy_field_set_state( $field ) {
return 'state';
}
@jeremyescott
jeremyescott / matador_variable_api_redirect_uri_set_null.php
Created November 29, 2017 17:01
Use Matador without a Redirect URI for Bullhorn
/**
* Authorize Matador without a Redirect URI set
*
* Recommended to use this only in development mode or while waiting for Bullhorn to set a
* new redirect URI for your API user. Letting Matador check the redirect URI is an essential
* safety check for your software.
*/
add_filter( 'matador_variable_api_redirect_uri', '__return_false' );
@jeremyescott
jeremyescott / add_ID_attribute_to_main_element_genesis
Created May 3, 2017 20:46
Add ID attribute to Genesis HTML5 Markup
// https://www.itnota.com/adding-id-attribute-genesis-main-content/
//
// Adds consideration for high level error reporting
// Add id="content" attributes to <main> element
add_filter( 'genesis_attr_content', 'my_attr_content' );
function my_attr_content( $attr ) {
if( array_key_exists( 'id', $attr ) {