Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent issues with ACF time picker #111

Merged
merged 6 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion includes/admin_meeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ function tsml_move_author_meta_box() {
add_meta_box('authordiv', __('Editor', '12-step-meeting-list'), 'post_author_meta_box', 'tsml_meeting', 'side', 'default');
}

// Hook tsml_assets where we can check $post_type
add_action( 'admin_print_scripts-post.php', 'tsml_assets' );
add_action( 'admin_print_scripts-post-new.php', 'tsml_assets' );

//edit page
add_action('admin_init', 'tsml_admin_init');
function tsml_admin_init() {

tsml_assets();
// tsml_assets();

add_meta_box('info', __('Meeting Information', '12-step-meeting-list'), 'tsml_meeting_box', 'tsml_meeting', 'normal', 'low');

Expand Down
2 changes: 1 addition & 1 deletion includes/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function tsml_ajax_groups() {
'contact_3_phone' => @$group_custom['contact_3_phone'][0],
'last_contact' => @$group_custom['last_contact'][0],
'notes' => $group->post_content,
'tokens' => tsml_string_tokens($title),
'tokens' => tsml_string_tokens($group->post_title),
joshreisner marked this conversation as resolved.
Show resolved Hide resolved
'type' => 'group',
);
}
Expand Down
6 changes: 5 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ function tsml_alert($message, $type='success') {
//function: enqueue assets for public or admin page
//used: in templates and on admin_edit.php
function tsml_assets() {
global $tsml_street_only, $tsml_programs, $tsml_strings, $tsml_program, $tsml_google_maps_key, $tsml_mapbox_key, $tsml_google_overrides, $tsml_distance_units, $tsml_defaults, $tsml_language, $tsml_columns, $tsml_nonce;
global $post_type, $tsml_street_only, $tsml_programs, $tsml_strings, $tsml_program, $tsml_google_maps_key, $tsml_mapbox_key, $tsml_google_overrides, $tsml_distance_units, $tsml_defaults, $tsml_language, $tsml_columns, $tsml_nonce;

// TODO: verify this doesn't cause any other issues
if ( isset( $post_type ) && 'tsml_meeting' !== $post_type ) {
return;
}
//google maps api
if ($tsml_google_maps_key) {
wp_enqueue_script('google_maps_api', '//maps.googleapis.com/maps/api/js?key=' . $tsml_google_maps_key);
Expand Down
6 changes: 5 additions & 1 deletion templates/archive-meetings.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,11 @@ function tsml_body_class($classes)
<?php
break;

case 'distance': ?>
case 'distance':
joshreisner marked this conversation as resolved.
Show resolved Hide resolved
if ( ! isset( $meeting['distance'] ) ) {
break;
}
?>
<td class="distance" data-sort="<?php echo $meeting['distance'] ?>"><?php echo $meeting['distance'] ?></td>
<?php
break;
Expand Down