/** * Output the metabox */ public static function output($post) { global $post; $post_id = $post->ID; $link_new_window = get_post_meta($post_id, 'wpcm_link_nw', true); wp_nonce_field('wpclubmanager_save_data', 'wpclubmanager_meta_nonce'); do_action('wpclubmanager_before_admin_sponsors_meta', $post_id); wpclubmanager_wp_text_input(array('id' => 'wpcm_link_url', 'label' => __('Link URL', 'wp-club-manager'), 'class' => 'regular-text')); ?> <p class="wpcm_link_nw_field"> <label for="wpcm_link_nw"><?php _e('Open link in new window?', 'wp-club-manager'); ?> </label> <input type="checkbox" name="wpcm_link_nw" id="wpcm_link_nw" value="1" <?php checked(true, $link_new_window); ?> /> </p> <?php do_action('wpclubmanager_after_admin_sponsors_meta'); }
/** * Output the metabox */ public static function output($post) { wp_nonce_field('wpclubmanager_save_data', 'wpclubmanager_meta_nonce'); $post_id = $post->ID; $comps = get_the_terms($post_id, 'wpcm_comp'); $wpcm_comp_status = get_post_meta($post_id, 'wpcm_comp_status', true); $team = get_post_meta($post_id, 'wpcm_team', true); $neutral = get_post_meta($post_id, 'wpcm_neutral', true); if (is_array($comps)) { $comp = $comps[0]->term_id; $comp_slug = $comps[0]->slug; } else { $comp = 0; $comp_slug = null; } $seasons = get_the_terms($post->ID, 'wpcm_season'); if (is_array($seasons)) { $season = $seasons[0]->term_id; } else { $season = -1; } $teams = get_the_terms($post->ID, 'wpcm_team'); if (is_array($teams)) { $team = $teams[0]->term_id; } else { $team = -1; } $venues = get_the_terms($post->ID, 'wpcm_venue'); if (is_array($venues)) { $venue = $venues[0]->term_id; } else { $venue = -1; } ?> <p> <label><?php _e('Competition', 'wp-club-manager'); ?> </label> <?php wp_dropdown_categories(array('show_option_none' => __('None'), 'orderby' => 'title', 'hide_empty' => false, 'taxonomy' => 'wpcm_comp', 'selected' => $comp, 'name' => 'wpcm_comp', 'class' => 'chosen_select')); ?> <input type="text" name="wpcm_comp_status" id="wpcm_comp_status" value="<?php echo $wpcm_comp_status; ?> " placeholder="Round (Optional)" /> </p> <p> <label><?php _e('Season', 'wp-club-manager'); ?> </label> <?php wp_dropdown_categories(array('show_option_none' => __('None'), 'orderby' => 'title', 'hide_empty' => false, 'taxonomy' => 'wpcm_season', 'selected' => $season, 'name' => 'wpcm_season', 'class' => 'chosen_select')); ?> </p> <p> <label><?php _e('Team', 'wp-club-manager'); ?> </label> <?php wp_dropdown_categories(array('show_option_all' => __('All'), 'orderby' => 'title', 'hide_empty' => false, 'taxonomy' => 'wpcm_team', 'selected' => $team, 'name' => 'wpcm_match_team', 'class' => 'chosen_select')); ?> </p> <p> <label><?php _e('Venue', 'wp-club-manager'); ?> </label> <?php wp_dropdown_categories(array('show_option_none' => __('None'), 'orderby' => 'title', 'hide_empty' => false, 'taxonomy' => 'wpcm_venue', 'selected' => $venue, 'name' => 'wpcm_venue', 'class' => 'chosen_select')); ?> <label class="selectit wpcm-cb-block"> <input type="checkbox" name="wpcm_neutral" id="wpcm_neutral" value="1" <?php checked(true, $neutral); ?> /> <?php _e('Neutral?', 'wp-club-manager'); ?> </label> </p> <?php wpclubmanager_wp_text_input(array('id' => 'wpcm_attendance', 'label' => __('Attendance', 'wp-club-manager'), 'class' => 'small-text')); wpclubmanager_wp_text_input(array('id' => 'wpcm_referee', 'label' => __('Referee', 'wp-club-manager'), 'class' => 'regular-text')); }
/** * Output the metabox */ public static function output($post) { global $post, $wp_locale; wp_nonce_field('wpclubmanager_save_data', 'wpclubmanager_meta_nonce'); $number = get_post_meta($post->ID, 'wpcm_number', true); $position_id = null; $positions = get_the_terms($post->ID, 'wpcm_position'); $position_ids = array(); if ($positions) { foreach ($positions as $position) { $position_ids[] = $position->term_id; } } $dob = get_post_meta($post->ID, 'wpcm_dob', true); if (empty($dob)) { $dob = '1988-01-01'; } $dob_day = substr($dob, 8, 2); $dob_month = substr($dob, 5, 2); $dob_year = substr($dob, 0, 4); $height = get_post_meta($post->ID, 'wpcm_height', true); $weight = get_post_meta($post->ID, 'wpcm_weight', true); $natl = get_post_meta($post->ID, 'wpcm_natl', true); $hometown = get_post_meta($post->ID, 'wpcm_hometown', true); $prevclubs = get_post_meta($post->ID, 'wpcm_prevclubs', true); $time_adj = current_time('timestamp'); wpclubmanager_wp_text_input(array('id' => 'wpcm_number', 'label' => __('Squad Number', 'wp-club-manager'), 'class' => 'small-text')); ?> <p> <label><?php _e('Position', 'wp-club-manager'); ?> </label> <?php $args = array('taxonomy' => 'wpcm_position', 'name' => 'tax_input[wpcm_position][]', 'selected' => $position_ids, 'values' => 'term_id', 'placeholder' => sprintf(__('Choose %s', 'wp-club-manager'), __('positions', 'wp-club-manager')), 'class' => '', 'attribute' => 'multiple', 'chosen' => true); wpcm_dropdown_taxonomies($args); ?> </p> <p> <label><?php _e('Date of Birth', 'wp-club-manager'); ?> </label> <select name="wpcm_dob_day" id="wpcm_dob_day" class="chosen_select_dob"> <?php for ($a = 1; $a < 32; $a = $a + 1) { ?> <option value="<?php echo zeroise($a, 2); ?> "<?php echo $a == $dob_day ? ' selected="selected"' : ''; ?> > <?php echo zeroise($a, 2); ?> </option> <?php } ?> </select> <select name="wpcm_dob_month" id="wpcm_dob_month" class="chosen_select_dob"> <?php for ($i = 1; $i < 13; $i = $i + 1) { ?> <option value="<?php echo zeroise($i, 2); ?> "<?php echo $i == $dob_month ? ' selected="selected"' : ''; ?> > <?php echo zeroise($i, 2); ?> -<?php echo $wp_locale->get_month_abbrev($wp_locale->get_month($i)); ?> </option> <?php } ?> </select> <input type="text" name="wpcm_dob_year" id="wpcm_dob_year" value="<?php echo $dob_year; ?> " size="4" maxlength="4" autocomplete="off" /> </p><?php wpclubmanager_wp_text_input(array('id' => 'wpcm_height', 'label' => __('Height', 'wp-club-manager'), 'class' => 'measure-text')); wpclubmanager_wp_text_input(array('id' => 'wpcm_weight', 'label' => __('Weight', 'wp-club-manager'), 'class' => 'measure-text')); wpclubmanager_wp_text_input(array('id' => 'wpcm_hometown', 'label' => __('Birthplace', 'wp-club-manager'), 'class' => 'regular-text')); wpclubmanager_wp_country_select(array('id' => 'wpcm_natl', 'label' => __('Nationality', 'wp-club-manager'))); wpclubmanager_wp_textarea_input(array('id' => 'wpcm_prevclubs', 'label' => __('Previous Clubs', 'wp-club-manager'), 'class' => 'regular-text')); }
/** * Output the metabox */ public static function output($post) { global $post, $wp_locale; wp_nonce_field('wpclubmanager_save_data', 'wpclubmanager_meta_nonce'); $job_id = null; $jobs = get_the_terms($post->ID, 'wpcm_jobs'); $job_ids = array(); if ($jobs) { foreach ($jobs as $job) { $job_ids[] = $job->term_id; } } $dob = get_post_meta($post->ID, 'wpcm_dob', true); if (empty($dob)) { $dob = '1988-01-01'; } $dob_day = substr($dob, 8, 2); $dob_month = substr($dob, 5, 2); $dob_year = substr($dob, 0, 4); $natl = get_post_meta($post->ID, 'wpcm_natl', true); $time_adj = current_time('timestamp'); ?> <p> <label><?php _e('Job Title', 'wp-club-manager'); ?> </label> <?php $args = array('taxonomy' => 'wpcm_jobs', 'name' => 'tax_input[wpcm_jobs][]', 'selected' => $job_ids, 'values' => 'term_id', 'placeholder' => sprintf(__('Choose %s', 'wp-club-manager'), __('jobs', 'wp-club-manager')), 'class' => '', 'attribute' => 'multiple', 'chosen' => true); wpcm_dropdown_taxonomies($args); ?> </p> <?php wpclubmanager_wp_text_input(array('id' => '_wpcm_staff_email', 'label' => __('Email Address', 'wp-club-manager'), 'class' => 'regular-text')); wpclubmanager_wp_text_input(array('id' => '_wpcm_staff_phone', 'label' => __('Contact Number', 'wp-club-manager'), 'class' => 'regular-text')); ?> <p> <label><?php _e('Date of Birth', 'wp-club-manager'); ?> </label> <select name="wpcm_dob_day" id="wpcm_dob_day" class="chosen_select_dob"> <?php for ($i = 1; $i < 32; $i = $i + 1) { ?> <option value="<?php echo zeroise($i, 2); ?> "<?php echo $i == $dob_day ? ' selected="selected"' : ''; ?> > <?php echo zeroise($i, 2); ?> </option> <?php } ?> </select> <select name="wpcm_dob_month" id="wpcm_dob_month" class="chosen_select_dob"> <?php for ($i = 1; $i < 13; $i = $i + 1) { ?> <option value="<?php echo zeroise($i, 2); ?> "<?php echo $i == $dob_month ? ' selected="selected"' : ''; ?> > <?php echo zeroise($i, 2); ?> -<?php echo $wp_locale->get_month_abbrev($wp_locale->get_month($i)); ?> </option> <?php } ?> </select> <input type="text" name="wpcm_dob_year" id="wpcm_dob_year" value="<?php echo $dob_year; ?> " size="4" maxlength="4" autocomplete="off" /> </p><?php wpclubmanager_wp_country_select(array('id' => 'wpcm_natl', 'label' => __('Nationality', 'wp-club-manager'))); }