Skip to content

Instantly share code, notes, and snippets.

🤓
in the zone

Myles McNamara tripflex

🤓
in the zone
Block or report user

Report or block tripflex

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tripflex
tripflex / functions.php
Created Jun 25, 2019
Custom excerpt number of words for Job Description when using WP Job Manager Visibility plugin
View functions.php
<?php
add_filter( 'job_manager_visibility_job_description_num_words', 'smyles_custom_description_excerpt_length' );
function smyles_custom_description_excerpt_length( $length ){
// Default is 55 words, return the number of words to customize length of excerpt
return 25;
}
@tripflex
tripflex / style.css
Created Jun 6, 2019
Fix JobHunt Chosen.JS multi-select dropdown expanding after initial selection
View style.css
/* To fix JobHunt Chosen Multiselect dropdown showing expanded when has search selections */
fieldset > .field > .chosen-container-multi >.chosen-choices > .search-field > input[type="text"] {
margin: 0.75em 1em;
padding: 0px;
}
@tripflex
tripflex / functions.php
Created May 6, 2019
Remove auto populate current user email for application meta key in admin area on new listings for WP Job Manager
View functions.php
<?php
add_filter( 'job_manager_job_listing_data_fields', 'smyles_remove_auto_populate_application_email', 999999999, 2 );
/**
* Remove Auto Populate application meta key with user email in admin area
*
* @see https://github.com/Automattic/WP-Job-Manager/issues/1591
*
* @param $fields
@tripflex
tripflex / sl.js
Created May 6, 2019
Slovenian locals for flatpickr
View sl.js
/* Slovenian locals for flatpickr */
var Flatpickr = Flatpickr || {l10ns: {}};
Flatpickr.l10ns.sl = {};
Flatpickr.l10ns.sl.weekdays = {
shorthand: [ "Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob" ],
longhand : [ "Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota" ],
};
Flatpickr.l10ns.sl.months = {
@tripflex
tripflex / functions.php
Created Apr 22, 2019
Customize label when using Auto Output with WP Job Manager Field Editor
View functions.php
<?php
add_filter( 'field_editor_output_as_args', 'smyles_my_custom_label_output', 10, 4 );
function smyles_my_custom_label_output( $args, $field_value, $meta_key, $listing_id ){
if( $meta_key === 'my_meta_key' ){
$args['label'] = "My Custom Label";
}
@tripflex
tripflex / bump_version.sh
Created Apr 11, 2019
Bash/Shell script to automatically increment Mongoose OS mos.yml version numbers
View bump_version.sh
#!/usr/bin/env bash
# Usage: ./bump_version.sh <major|minor|patch> - Increments the relevant version part by one.
#
# Usage 2: ./bump_version.sh <version-from> <version-to>
# e.g: ./bump_version.sh 1.1.1 2.0
# Specifically coded for Mac OSX
# You must install grep from brew, like this:
# brew install coreutils
@tripflex
tripflex / functions.php
Created Mar 29, 2019
Customize the GET param used for auto populate WP Job Manager Field Editor fields
View functions.php
<?php
add_filter( 'job_manager_field_editor_url_populate_from_key', 'smyles_auto_populate_from_get_custom', 10, 3 );
function smyles_auto_populate_from_get_custom( $meta_key, $args, $return_default ){
if( $meta_key === 'job_title' ){
return 'job_title_custom';
}
@tripflex
tripflex / job.php
Created Mar 25, 2019
Validate a Job/Listing or Resume Date Picker field is 18 years or more in the past (validate 18 years or older) when using WP Job Manager Field Editor
View job.php
<?php
add_filter( 'submit_job_form_validate_fields', 'smyles_validate_job_birthday_over_18', 10, 3 );
/**
* Validate a Job/Listing Date Field is 18 years or more in the past
*
*
* @param $has_error
* @param $fields
@tripflex
tripflex / functions.php
Created Mar 18, 2019
Remove taxonomy from keyword search in WP Job Manager
View functions.php
<?php
add_filter( 'job_listing_search_conditions', 'smyles_remove_taxonomy_from_search_keywords' );
function smyles_remove_taxonomy_from_search_keywords( $conditions ){
if( ! empty( $conditions ) ){
foreach( $conditions as $index => $condition ){
@tripflex
tripflex / functions.php
Last active Mar 6, 2019
Click Apply button automatically after user selects user package to contact Job Listing/Listinig (for WP Job Manager Packages)
View functions.php
<?php
add_filter( 'job_manager_packages_form_user_package_add_post_redirect', 'smyles_click_contact_btn_after_select_contact_pkg', 10, 5 );
add_action( 'job_application_start', 'smyles_check_click_apply_btn' );
/**
* Add cookie after user selects own package to contact resume
*
* This method will be called when a user selects a specific contact package to use to contact a resume, and it will
* set a cookie that will be read when the page reloads/redirects, and will automatically click the contact button.
*
You can’t perform that action at this time.