post_type == 'tsml_meeting') { $title = __('Enter meeting name', '12-step-meeting-list'); } return $title; }); // move author meta box to right side add_action('do_meta_boxes', function () { remove_meta_box('authordiv', 'tsml_meeting', 'normal'); add_meta_box('authordiv', __('Editor', '12-step-meeting-list'), 'post_author_meta_box', 'tsml_meeting', 'side', 'default'); }); // add admin assets to tsml screens only add_action('admin_enqueue_scripts', function () { $screen = get_current_screen(); if (is_object($screen) && $screen->post_type === 'tsml_meeting') { tsml_assets(); } }); // edit page add_action('admin_init', function () { // compares versions and updates databases as needed for upgrades $tsml_version = get_option('tsml_version'); if (version_compare($tsml_version, TSML_VERSION, '<')) { // do this every time update_option('tsml_version', TSML_VERSION); flush_rewrite_rules(); }; add_meta_box('info', __('Meeting Information', '12-step-meeting-list'), function () { global $tsml_days, $tsml_programs, $tsml_program, $tsml_nonce, $tsml_types_in_use; $meeting = tsml_get_meeting(); $languages = tsml_languages(); $types = array_diff_key($tsml_programs[$tsml_program]['types'], array_merge($languages, array_fill_keys(['ONL', 'TC'], true))); $user_language = strtoupper(substr(get_user_locale(), 0, 2)); // time is before the end of april and not currently using temporary closure if (!in_array('TC', $tsml_types_in_use) && time() < strtotime('2020-04-30')) { tsml_alert('Please note: a new “Temporary Closure” meeting type has recently been added. Use this to indicate meetings that are temporarily not meeting. Find it under “View all” below.', 'warning'); } if (!empty($meeting->data_source)) { $data_source_name = property_exists($meeting, 'data_source_name') ? $meeting->data_source_name : $meeting->data_source; $message = sprintf( // translators: %s is the data source name __('This meeting was imported from an external feed %s. Any changes you make here will be overwritten when you refresh the data.', '12-step-meeting-list'), "$data_source_name" ); tsml_alert($message, 'warning'); } // nonce field wp_nonce_field($tsml_nonce, 'tsml_nonce', false); ?>
post_parent) { $location = tsml_get_location($meeting->post_parent); $meetings = tsml_get_meetings(['location_id' => $location->ID]); } ?> 1) { ?> timezone) && empty($tsml_timezone) && $tsml_user_interface === 'tsml_ui') { ?> 1) { ?> Optional', '12-step-meeting-list'), function () { global $tsml_contact_display; $meeting = tsml_get_meeting(); $meetings = []; $district = 0; if (!empty($meeting->group_id)) { $meetings = tsml_get_meetings(['group_id' => $meeting->group_id]); $district = wp_get_post_terms($meeting->group_id, 'tsml_district', ['fields' => 'ids']); if (is_array($district)) { $district = empty($district) ? 0 : $district[0]; } } ?>