This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gform_save_field_value', 'jmd_date_format', 10, 4 ); | |
function jmd_date_format( $value, $entry, $field, $form ) { | |
$fields = [ | |
6 => 'm/d/Y', | |
22 => 'm/d/Y, h:i A' | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Usage: [recent_listings type="event" range="today" text="events added today"] | |
// Range examples: today, 3 days ago, 2 weeks ago, 1 week ago, 1 month ago (for all possible formats see: https://www.php.net/manual/en/datetime.formats.relative.php) | |
add_shortcode( 'recent_listings', 'jmd_count_recent' ); | |
function jmd_count_recent( $atts ) { | |
$args=shortcode_atts( array ( | |
'type' => 'event', | |
'range' => 'today', | |
'text' => '' | |
), $atts ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('init', 'jmd_phone_field_format'); | |
function jmd_phone_field_format(){ | |
$args = array( | |
'post_type' => 'job_listing', | |
'post_status' => 'publish', | |
'posts_per_page' => -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('admin_enqueue_scripts', 'custom_admin_scripts' ); | |
function custom_admin_scripts() { | |
global $pagenow; | |
if ( 'post.php' === $pagenow && isset($_GET['post']) && 'job_listing' === get_post_type( $_GET['post'] ) ) { | |
wp_enqueue_script( 'jquery-mask', get_stylesheet_directory_uri() .'/js/jquery.mask.js' , array('jquery'), null, true ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.10/jquery.mask.js"></script> | |
<script> | |
jQuery(document).ready(function($) { | |
$("#job_phone").mask("(999) 999-9999"); | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// author posts (rename buddypress.js -> author.js and add to child theme in js directory) | |
add_shortcode( 'seller_posts', 'ml_author_posts' ); | |
function ml_author_posts() { | |
if( 'job_listing' != get_post_type( $post_id ) ) { | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()->ticket_add( $event_id, [ | |
'ticket_name' => 'Test ticket ' . uniqid(), | |
'ticket_provider' => 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main', | |
'ticket_price' => '100', | |
'tribe_ticket' => [ | |
'mode' => 'global', | |
'event_capacity' => '100', | |
'capacity' => '' | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // <-- Omit this PHP tag prior to adding to functions.php | |
/* Re-hook WooTickets form - add to functions.php in Mylisting child theme */ | |
add_action ( 'init', 'tribe_rehook_tickets_form' ); | |
function tribe_rehook_tickets_form ( ) { | |
if ( ! class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shopper_list_found_print ($query_args) { | |
$query_args = array ( | |
'post_type' => 'shopper', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'shopper_categories', | |
'field' => 'slug', | |
'terms' => array('found'), |
NewerOlder