Skip to content

Instantly share code, notes, and snippets.

View tripflex's full-sized avatar
🦋
in the zone

Myles McNamara tripflex

🦋
in the zone
View GitHub Profile
@tripflex
tripflex / leaflet-clusters.css
Created May 18, 2023 19:20
Leaflet Marker Cluster Default Colors
.marker-cluster-small {
background-color: rgba(181,226,140,.6)
}
.marker-cluster-small div {
background-color: rgba(110,204,57,.6)
}
.marker-cluster-medium {
background-color: rgba(241,211,87,.6)
@tripflex
tripflex / functions.php
Created February 9, 2023 00:29
Custom Singular "Job" Value when using Search and Filtering Result Replacement
<?php
add_filter('search_and_filtering_job_singular', 'smyles_sf_job_singular');
function smyles_sf_job_singular( $singular ){
return __('job today');
}
add_filter('search_and_filtering_job_plural', 'smyles_sf_job_plural');
function smyles_sf_job_plural( $singular ){
@tripflex
tripflex / functions.php
Last active November 29, 2022 22:37
Disable showing localize() warning when WP_DEBUG is enabled
<?php
add_filter( 'doing_it_wrong_trigger_error', 'smyles_disable_localize_warning', 9999, 2 );
function smyles_disable_localize_warning( $trigger, $function ){
if( $function === 'WP_Scripts::localize' ){
return false;
}
return $trigger;
}
@tripflex
tripflex / functions.php
Created November 21, 2022 22:49
Hide child terms for specific taxonomy when using Search and Filtering (requires 1.1.29 or newer)
<?php
add_filter( 'search_and_filtering_get_taxonomy_data_options_include_child_terms', 'smyles_tax_child_terms', 10, 2 );
function smyles_tax_child_terms( $args, $taxonomy ){
if( $taxonomy === 'job_listing_category' ){
return false;
}
@tripflex
tripflex / functions.php
Created October 18, 2022 22:18
Prevent specific email templates from sending when the user is an administrator
<?php
add_filter( 'job_manager_emails_email_should_send', 'smyles_email_should_send', 10, 4 );
function smyles_email_should_send( $should_send, $template, $listing_id, $that ) {
// Don't send if the user IS an admin submitting the application
if ( $template->template_name && 'application_confirmation_non_admin' === $template->template_name && current_user_can( 'manage_options' ) ) {
return false;
}
@tripflex
tripflex / functions.php
Created July 27, 2022 22:13
Don't include anywhere listings for Radius Searches (when using WP Job Manager Search and Filtering)
<?php
add_filter( 'search_and_filtering_job_radius_search_include_anywhere', '__return_false' );
@tripflex
tripflex / functions.php
Created July 26, 2022 21:33
Customize WP Job Manager Select2 Arguments
<?php
add_filter( 'job_manager_select2_args', 'smyles_custom_select2_args' );
function smyles_custom_select2_args( $args ){
$args['minimumInputLength'] = 2;
return $args;
}
@tripflex
tripflex / functions.php
Created July 1, 2022 15:50
Lower total per batch when using empty meta cleaner cleanup existing empty post meta
<?php
add_filter( 'job_manager_empty_meta_cleaner_init_configuration', 'smyles_emc_lower_per_batch' );
function smyles_emc_lower_per_batch( $config ){
$config['total_per_batch'] = 10;
return $config;
}
@tripflex
tripflex / functions.php
Created May 5, 2022 21:55
Prevent featured jobs from showing above listing results when searching by radius with WP Job Manager Search and Filtering
<?php
add_filter( 'search_and_filtering_feature_listings_in_location_search', '__return_false' );
@tripflex
tripflex / fr.js
Created April 28, 2022 22:03
French flatpickr override template file (place in /flatpickr/ directory in child theme directory) for WP Job Manager Field Editor (to add range separator)
/* French locals for flatpickr */
var Flatpickr = Flatpickr || { l10ns: {} };
Flatpickr.l10ns.fr = {};
Flatpickr.l10ns.fr.firstDayOfWeek = 1;
Flatpickr.l10ns.fr.weekdays = {
shorthand: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
longhand: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
};