Changeset 3290731
- Timestamp:
- 05/10/2025 03:06:44 AM (10 months ago)
- Location:
- coaching-staffs/trunk
- Files:
-
- 9 edited
-
includes/mstw-admin-utils.php (modified) (8 diffs)
-
includes/mstw-coaching-staffs-admin.php (modified) (40 diffs)
-
includes/mstw-cs-utility-functions.php (modified) (4 diffs)
-
includes/mstw-utility-functions.php (modified) (20 diffs)
-
lang/mstw-coaching-staffs-en_US.pot (modified) (4 diffs)
-
mstw-coaching-staffs.php (modified) (14 diffs)
-
readme.txt (modified) (1 diff)
-
theme-templates/single-coach.php (modified) (8 diffs)
-
theme-templates/taxonomy-staffs.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coaching-staffs/trunk/includes/mstw-admin-utils.php
r3215779 r3290731 5 5 * 6 6 * MSTW Wordpress Plugins 7 * Copyright (C) 2013-2 4Mark O'Donnell7 * Copyright (C) 2013-25 Mark O'Donnell 8 8 * Contact me at http://shoalsummitsolutions.com 9 9 * … … 64 64 $label = $args['label']; 65 65 66 echo "<input type='text' id='$id' name='$name' value='$value' /> \n"; 67 echo ($label != '') ? "<br /><span class='description'>$label</span>" : ""; 66 //echo "<input type='text' id='$id' name='$name' value='$value' /> \n"; 67 ?> 68 <input type='text' id='<?php echo esc_html( $id ) ?>' name='<?php echo esc_html( $name ) ?>' value='<?php echo esc_html( $value ) ?>' /></br> 69 <?php 70 //echo ($label != '') ? "<br /><span class='description'>$label</span>" : ""; 71 if ( $label != '' ) { 72 ?> 73 <span class='description'><?php echo esc_html( $label ) ?></span> 74 <?php 75 } 68 76 //echo "<label for='$id'>$label</label> \n"; 69 77 … … 83 91 *---------------------------------------------------------------*/ 84 92 function mstw_utl_text_ctrl( $args ) { 93 //mstw_log_msg( "mstw_utl_text_ctrl: args:" ); 94 //mstw_log_msg( $args ); 95 85 96 $id = $args['id']; 86 97 $name = $args['name']; … … 88 99 $label = $args['label']; 89 100 90 echo "<input type='text' id='$id' name='$name' value='$value' /> \n"; 101 //echo "<input type='text' id='$id' name='$name' value='$value' /> \n" ; 102 ?> 103 <input type='text' id='<?php echo esc_html( $id ) ?>' name='<?php echo esc_html( $name ) ?>' value='<?php echo esc_html( $value ) ?>' /></br> 104 <?php 91 105 //echo "<label for='$id'>$label</label> \n"; 92 echo ($label != '') ? "<br /><span class='description'>$label</span>" : ""; 106 //echo ($label != '') ? wp_kses_post( "<br /><span class='description'>$label</span>" ) : ""; 107 if ( $label != '' ) { 108 ?> 109 <span class='description'><?php echo esc_html( $label ) ?></span> 110 <?php 111 } 93 112 94 113 } //End: mstw_utl_text_ctrl … … 109 128 *---------------------------------------------------------------*/ 110 129 function mstw_utl_checkbox_ctrl( $args ) { 130 //mstw_log_msg( "mstw_utl_checkbox_ctrl:" ); 131 111 132 $id = $args['id']; 112 133 $name = $args['name']; … … 114 135 $label = $args['label']; 115 136 116 echo "<input type='checkbox' id='$id' name='$name' value='1' " . 117 checked( '1', $value, false ) . "/> \n"; 118 //echo "<label for='$id'>$label</label> \n"; 119 echo ($label != '') ? "<br /><span class='description'>$label</span>" : ""; 137 echo wp_kses_post( "<input type='checkbox' id='$id' name='$name' value='1' " . 138 checked( '1', $value, false ) . "/> \n" ); 139 140 if ( $label != '' ) { 141 ?><br /><span class='<?php echo esc_html( description ) ?>' <?php echo esc_html( $label ) ?> </span> 142 <?php 143 } 144 else { 145 echo esc_html( "" ) ; 146 } 120 147 121 148 } //End: mstw_utl_checkbox_ctrl … … 135 162 *---------------------------------------------------------------*/ 136 163 function mstw_utl_show_hide_ctrl( $args ) { 137 138 $new_args = array( 'options' => array( __( 'Show', 'mstw-loc-domain' ) => 1, 139 __( 'Hide', 'mstw-loc-domain' ) => 0, 164 //mstw_log_msg( "mstw_utl_show_hide_ctrl:" ); 165 166 $new_args = array( 'options' => array( __( 'Show', 'coaching-staffs' ) => 1, 167 __( 'Hide', 'coaching-staffs' ) => 0, 140 168 ), 141 169 'id' => $args['id'], … … 157 185 * $args['name'] (string) Name of input field 158 186 * $args['value'] (string) Current value of setting 159 * $args['label'] (string) Default to use of setting is blank187 * $args['label'] (string) Default to use if setting is blank 160 188 * 161 189 * Return - none. Output is echoed. 162 190 *---------------------------------------------------------------*/ 163 191 function mstw_utl_select_option_ctrl( $args ) { 164 192 //mstw_log_msg( "mstw_utl_select_option_ctrl: args: " ); 193 //mstw_log_msg( $args ); 194 165 195 $options = $args['options']; 166 196 $name = $args['name']; 167 197 $id = $args['id']; 198 168 199 $curr_value = $args['value']; 169 200 $label = $args['label']; 170 201 171 echo "<select id='$id' name='$name' style='width: 160px' >"; 202 //echo "<select id='$id' name='$name' style='width: 160px' >"; 203 ?> 204 <select id= <?php echo esc_html( $id ) ?> name= <?php echo esc_html( $name ) ?> style='width: 160px' > 205 <?php 172 206 foreach( $options as $key=>$value ) { 173 //echo '<p> key: ' . $key . ' value: ' . $value .'</p>'; 174 $selected = ( $curr_value == $value ) ? 'selected="selected"' : ''; 175 echo "<option value='$value' $selected>$key</option>"; 207 $selected = ( $curr_value == $value ) ? ' selected' : ''; 208 ?> 209 <option value='<?php echo esc_html( $value ) ?>'<?php echo esc_html( $selected ) ?> > <?php echo esc_html( $key ) ?> </option> 210 <?php 176 211 } 177 212 echo "</select> \n"; 178 //echo "<label for='$id'>". $label . "</label> \n"; 179 //echo "<label for='$id'>$label</label> \n"; 180 echo ($label != '') ? "<br /><span class='description'>$label</span>" : ""; 213 echo ($label != '') ? wp_kses_post( "<br /><span class='description'>$label</span>" ) : ""; 181 214 182 215 } //End: mstw_utl_select_option_ctrl -
coaching-staffs/trunk/includes/mstw-coaching-staffs-admin.php
r3215779 r3290731 6 6 7 7 /*----------------------------------------------------------------------------------- 8 Copyright 2012-2 4Mark O'Donnell (email : [email protected])8 Copyright 2012-25 Mark O'Donnell (email : [email protected]) 9 9 10 10 This program is free software: you can redistribute it and/or modify … … 60 60 wp_enqueue_style( 'wp-color-picker' ); 61 61 //wp_enqueue_script( 'wp-color-picker' ); 62 wp_enqueue_script( 'wp-color-picker-settings', plugins_url( 'coaching-staffs/js/cs-color-settings.js' ), array( 'wp-color-picker' ), false, true );62 wp_enqueue_script( 'wp-color-picker-settings', plugins_url( 'coaching-staffs/js/cs-color-settings.js' ), array( 'wp-color-picker' ), "1.5", true ); 63 63 } 64 64 … … 75 75 function mstw_cs_custom_css() { 76 76 echo '<style type="text/css"> 77 #icon-mstw-cs-main-menu.icon32 {background: url( ' . plugins_url( '/coaching-staffs/images/mstw-logo-32x32.png', 'coaching-staffs') . ') transparent no-repeat;}78 #icon-coaching-staffs.icon32 {background: url( ' . plugins_url( '/coaching-staffs/images/mstw-logo-32x32.png', 'coaching-staffs') . ') transparent no-repeat;}79 #icon-edit.icon32-posts-staff_position {background: url( ' . plugins_url( '/coaching-staffs/images/mstw-logo-32x32.png', 'coaching-staffs' ). ') transparent no-repeat;}' .77 #icon-mstw-cs-main-menu.icon32 {background: url( ' . esc_url( plugins_url( '/coaching-staffs/images/mstw-logo-32x32.png', 'coaching-staffs' ) ) . ') transparent no-repeat;} 78 #icon-coaching-staffs.icon32 {background: url( ' . esc_url( plugins_url( '/coaching-staffs/images/mstw-logo-32x32.png', 'coaching-staffs' ) ) . ') transparent no-repeat;} 79 #icon-edit.icon32-posts-staff_position {background: url( ' . esc_url( plugins_url( '/coaching-staffs/images/mstw-logo-32x32.png', 'coaching-staffs' ) ). ') transparent no-repeat;}' . 80 80 '</style>'; 81 81 } … … 108 108 109 109 function mstw_cs_restrict_positions_by_staff( ) { 110 global $typenow; 111 112 if( $typenow == 'staff_position' ) { 113 114 $taxonomy_slugs = array( 'staffs' ); 115 116 foreach ( $taxonomy_slugs as $tax_slug ) { 117 //retrieve the taxonomy object for the tax_slug 118 $tax_obj = get_taxonomy( $tax_slug ); 119 $tax_name = $tax_obj->labels->name; 120 121 $terms = get_terms( $tax_slug ); 122 123 //output the html for the drop down menu 124 echo "<select name='$tax_slug' id='$tax_slug' class='postform'>"; 125 echo "<option value=''>". __( 'Show All Staffs', 'coaching-staffs') . "</option>"; 126 127 //output each select option line 128 foreach ($terms as $term) { 129 //check against the last $_GET to show the current selection 130 if ( array_key_exists( $tax_slug, $_GET ) ) { 131 $selected = ( $_GET[$tax_slug] == $term->slug )? ' selected="selected"' : ''; 132 } 133 else { 134 $selected = ''; 135 } 136 echo '<option value=' . $term->slug . $selected . '>' . $term->name . ' (' . $term->count . ')</option>'; 137 } 138 echo "</select>"; 139 } 140 } 110 //mstw_log_msg( "mstw_cs_restrict_positions_by_staff:" ); 111 112 global $typenow; 113 114 if( $typenow == 'staff_position' ) { 115 116 $taxonomy_slugs = array( 'staffs' ); 117 118 foreach ( $taxonomy_slugs as $tax_slug ) { 119 //retrieve the taxonomy object for the tax_slug 120 $tax_obj = get_taxonomy( $tax_slug ); 121 $tax_name = $tax_obj->labels->name; 122 $terms = get_terms( $tax_slug ); 123 124 //output the html for the drop down menu 125 ?><select name='<?php echo esc_html( $tax_slug )?>' id='<?php echo esc_html( $tax_slug )?>' class='postform'> 126 <option value=''><?php esc_html_e( 'Show All Staffs', 'coaching-staffs')?></option> 127 <?php 128 //output each select option line 129 foreach ($terms as $term) { 130 //check against the last $_GET to show the current selection 131 if ( array_key_exists( $tax_slug, $_GET ) ) { 132 $selected = ( $_GET[$tax_slug] == $term->slug ) ? ' selected' : ''; 133 } 134 else { 135 $selected = ''; 136 } 137 138 ?> 139 <option value='<?php echo esc_html( $term->slug )?>' <?php echo esc_html( $selected )?>> <?php echo esc_html( $term->name . '(' . $term->count . ')' ) ?> </option> 140 <?php 141 } 142 ?></select><?php 143 } 144 } 145 141 146 } //End: mstw_cs_restrict_positions_by_staff 142 147 143 144 // ---------------------------------------------------------------- 145 // Create the meta box for the Coaching Staff custom post type 146 add_action( 'add_meta_boxes', 'mstw_cs_add_meta_boxes' ); 147 148 function mstw_cs_add_meta_boxes () { 149 add_meta_box( 'mstw-cs-coach-meta', 150 __('Coach', 'coaching-staffs'), 148 //----------------------------------------------------------------- 149 // Add the meta box for the mstw_cs_coach custom post type 150 // 151 add_action( 'add_meta_boxes_coach', 'mstw_cs_coach_metaboxes' ); 152 153 if( !function_exists( 'mstw_cs_coach_metaboxes' ) ) { 154 function mstw_cs_coach_metaboxes( ) { 155 156 add_meta_box( 'mstw-cs_coach-meta', 157 __('Coach Data', 'coaching-staffs'), 151 158 'mstw_cs_coach_ui', 152 159 'coach', 153 'normal', 154 'high' ); 155 160 'advanced', 161 'high' ); 162 163 } //End: mstw_cs_coach_metaboxes( ) 164 } 165 166 //----------------------------------------------------------------- 167 // Add the meta box for the mstw_cs_coach custom post type 168 // 169 add_action( 'add_meta_boxes_staff_position', 'mstw_cs_staff_metaboxes' ); 170 171 if( !function_exists( 'mstw_cs_staff_metaboxes' ) ) { 172 function mstw_cs_staff_metaboxes( ) { 173 //mstw_log_msg( 'mstw_cs_staff_metaboxes:' ); 174 156 175 add_meta_box( 'mstw-cs-staff-position-meta', 157 176 __('Staff Position', 'coaching-staffs'), 158 177 'mstw_cs_staff_position_ui', 159 178 'staff_position', 160 ' normal',179 'advanced', 161 180 'high' ); 162 } 181 182 } //End: mstw_cs_staff_metaboxes( ) 183 } 184 185 //----------------------------------------------------------------- 186 // Move the meta box ahead of the content (coach bio) 187 // 188 add_action('edit_form_after_title', 'mstw_cs_build_coach_screen' ); 189 190 if( !function_exists( 'mstw_cs_build_coach_screen' ) ) { 191 function mstw_cs_build_coach_screen( ) { 192 //mstw_log_msg( 'mstw_cs_build_coach_screen' ); 193 194 global $post, $wp_meta_boxes; 195 196 // first make sure we're on the right screen ... 197 if( get_post_type( $post ) == 'coach' ) { 198 do_meta_boxes(get_current_screen( ), 'advanced', $post); 199 unset( $wp_meta_boxes[get_post_type($post)]['advanced'] ); 200 ?> 201 <p class='player-bio-admin-head'><?php esc_html_e( 'Coach Bio:', 'coaching-staffs' ) ?></p> 202 <?php 203 } 204 } //End: mstw_cs_build_coach_screen() 205 } 163 206 164 207 // ---------------------------------------------------------------------- … … 167 210 168 211 function mstw_cs_coach_ui( $post ) { 212 //mstw_log_msg( "mstw_cs_coach_ui:" ); 213 214 wp_nonce_field( 'edit-coaches', 'mstw-cs-nonce', false, true ); 215 169 216 // Retrieve the metadata values if they exist 170 217 $experience = get_post_meta( $post->ID, 'mstw_cs_experience', true ); … … 176 223 $family = get_post_meta( $post->ID, 'mstw_cs_family', true ); 177 224 ?> 178 179 <table class="form-table"> 180 181 <tr valign="top"> 182 <th scope="row"><label for="mstw_cs_experience" ><?php echo( __( 'Experience', 'coaching-staffs' ) . ':' ); ?> </label></th> 183 <td><input size="20" name="mstw_cs_experience" 184 value="<?php echo esc_attr( $experience ); ?>"/></td> 185 </tr> 186 <tr valign="top"> 187 <th scope="row"><label for="mstw_cs_alma_mater" ><?php echo( __( 'Alma Mater', 'coaching-staffs' ) . ':' ); ?> </label></th> 188 <td><input size="20" name="mstw_cs_alma_mater" 189 value="<?php echo esc_attr( $alma_mater ); ?>"/></td> 190 </tr> 191 <tr valign="top"> 192 <th scope="row"><label for="mstw_cs_degree" ><?php echo( __( 'Degree', 'coaching-staffs' ) . ':' ); ?> </label></th> 193 <td><input size="20" name="mstw_cs_degree" 194 value="<?php echo esc_attr( $degree ); ?>"/></td> 195 </tr> 196 <tr valign="top"> 197 <th scope="row"><label for="mstw_cs_birth_date" ><?php echo( __( 'Birth Date', 'coaching-staffs' ) . ':' ); ?> </label></th> 198 <td><input size="20" name="mstw_cs_birth_date" 199 value="<?php echo esc_attr( $birth_date ); ?>"/></td> 200 </tr> 201 <tr valign="top"> 202 <th scope="row"><label for="mstw_cs_home_town" ><?php echo( __( 'Home Town', 'coaching-staffs' ) . ':' ); ?> </label></th> 203 <td><input size="20" name="mstw_cs_home_town" 204 value="<?php echo esc_attr( $home_town ); ?>"/></td> 205 </tr> 206 <tr valign="top"> 207 <th scope="row"><label for="mstw_cs_high_school" ><?php echo( __( 'High School', 'coaching-staffs' ) . ':' ); ?> </label></th> 208 <td><input size="20" name="mstw_cs_high_school" 209 value="<?php echo esc_attr( $high_school ); ?>"/></td> 210 </tr> 211 <tr valign="top"> 212 <th scope="row"><label for="mstw_cs_family" ><?php echo( __( 'Family', 'coaching-staffs' ) . ':' ); ?> </label></th> 213 <td><textarea rows="5" cols="40" name="mstw_cs_family"> 214 <?php echo esc_attr( $family ); ?> </textarea></td> 215 </tr> 225 226 <table class="form-table" 227 <tr valign="top"> 228 <th scope="row"><label for="mstw_cs_experience" ><?php esc_html_e( 'Experience', 'coaching-staffs' ) ?>: </label></th> 229 <td><input size="20" name="mstw_cs_experience" 230 value="<?php echo esc_html( $experience ) ?>"/></td> 231 </tr> 232 <tr valign="top"> 233 <th scope="row"><label for="mstw_cs_alma_mater" ><?php esc_html_e( 'Alma Mater', 'coaching-staffs' ) ?>: </label></th> 234 <td><input size="20" name="mstw_cs_alma_mater" 235 value="<?php echo esc_html( $alma_mater ) ?>"/></td> 236 </tr> 237 <tr valign="top"> 238 <th scope="row"><label for="mstw_cs_degree" ><?php esc_html_e( 'Degree', 'coaching-staffs' ) ?>: </label></th> 239 <td><input size="20" name="mstw_cs_degree" 240 value="<?php echo esc_html( $degree ) ?>"/></td> 241 </tr> 242 <tr valign="top"> 243 <th scope="row"><label for="mstw_cs_birth_date" ><?php esc_html_e( 'Birth Date', 'coaching-staffs' ) ?>: </label></th> 244 <td><input size="20" name="mstw_cs_birth_date" 245 vvalue="<?php echo esc_html( $birth_date ) ?>"/></td> 246 </tr> 247 <tr valign="top"> 248 <th scope="row"><label for="mstw_cs_home_town" ><?php esc_html_e( 'Home Town', 'coaching-staffs' ) ?>: </label></th> 249 <td><input size="20" name="mstw_cs_home_town" 250 value="<?php echo esc_html( $home_town ); ?>"/></td> 251 </tr> 252 <tr valign="top"> 253 <th scope="row"><label for="mstw_cs_high_school" ><?php esc_html_e( 'High School', 'coaching-staffs' ) ?>: </label></th> 254 <td><input size="20" name="mstw_cs_high_school" 255 value="<?php echo esc_html( $high_school ) ?>"/></td> 256 </tr> 257 <tr valign="top"> 258 <th scope="row"><label for="mstw_cs_family" ><?php esc_html_e( 'Family', 'coaching-staffs' ) ?>: </label></th> 259 <td><textarea rows="5" cols="40" name="mstw_cs_family"> 260 <?php echo esc_html( $family ) ?> </textarea></td> 261 </tr> 216 262 217 263 </table> … … 225 271 226 272 function mstw_cs_staff_position_ui( $post ) { 273 //mstw_log_msg( "mstw_cs_staff_position_ui:" ); 274 227 275 // Retrieve the metadata values if they exist 228 276 $position_coach = get_post_meta( $post->ID, 'mstw_cs_position_coach', true ); 229 $display_order = get_post_meta( $post->ID, 'mstw_cs_display_order', true ); 277 $display_order = get_post_meta( $post->ID, 'mstw_cs_display_order', true ); 278 279 wp_nonce_field( 'edit-staffs', 'mstw-cs-nonce', false, true ); 230 280 ?> 231 281 … … 237 287 <select name="mstw_cs_position_coach" > <!--onchange='document.location.href=this.options[this.selectedIndex].value;'> --> 238 288 <option value=""> 239 <?php e cho esc_attr( __( 'Select coach', 'coaching-staffs' ) );?></option>289 <?php esc_html_e( 'Select coach', 'coaching-staffs' ) ?></option> 240 290 <?php 241 291 $args = array( … … 253 303 'post_parent' => '', 254 304 'post_status' => 'publish', 255 'suppress_filters' => true);305 'suppress_filters' => false /*true*/ ); 256 306 $coaches = get_posts( $args ); 257 307 258 308 foreach ( $coaches as $coach ) { 259 $selected = ( $coach->ID == $position_coach ) ? 'selected="selected"' : ''; 260 $option = '<option value="' . $coach->ID . '" ' . $selected . '>'; 261 $option .= $coach->post_title; 262 $option .= '</option>'; 263 echo $option; 309 $selected = ( $coach->ID == $position_coach ) ? 'selected="selected"' : ''; 310 ?> 311 <option value="<?php echo esc_html( $coach -> ID )?>" <?php echo esc_html( $selected ) ?> > <?php echo esc_html( $coach->post_title ) ?> </option> 312 <?php 264 313 } 265 314 ?> … … 269 318 270 319 <tr valign="top"> 271 <th scope="row"><label for="mstw_cs_display_order" ><?php e cho( __( 'Display Order:', 'coaching-staffs' ) );?> </label></th>320 <th scope="row"><label for="mstw_cs_display_order" ><?php esc_html_e( 'Display Order:', 'coaching-staffs' ) ?> </label></th> 272 321 <td><input maxlength="5" size="5" name="mstw_cs_display_order" 273 value="<?php echo esc_ attr( $display_order ); ?>"/></td>322 value="<?php echo esc_html( $display_order ); ?>"/></td> 274 323 </tr> 275 324 … … 278 327 <?php 279 328 } 280 281 329 282 330 // ---------------------------------------------------------------------- … … 285 333 286 334 function mstw_cs_save_meta_data( $post_id ) { 335 //mstw_log_msg( "mstw_cs_save_meta_data:" ); 336 287 337 global $typenow; 288 338 339 // 340 //Just return on an autosave 341 // 342 if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) 343 return $post_id; 344 345 if ( !isset( $_POST['mstw-cs-nonce'] ) ) { 346 die( esc_html__( "Irrecoverable error encountered saving data. Exiting.", 'coaching-staffs' ) ); 347 } else { //nonce is set, verify it 348 $safeNonce = mstw_safe_get( 'mstw-cs-nonce', $_POST, null ); 349 } 350 289 351 if ( $typenow == 'coach' ) { 352 if ( false == wp_verify_nonce( $safeNonce, 'edit-coaches' ) ) { 353 die( esc_html__( "Irrecoverable error encountered saving data. Exiting.", 'coaching-staffs' ) ); 354 } 290 355 //Strip tags for safety before storing strings 291 356 update_post_meta( $post_id, 'mstw_cs_experience', 292 strip_tags( $_POST['mstw_cs_experience']) );357 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_experience', $_POST ) ) ); 293 358 294 359 update_post_meta( $post_id, 'mstw_cs_alma_mater', 295 strip_tags( $_POST['mstw_cs_alma_mater']) );360 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_alma_mater', $_POST ) ) ); 296 361 297 362 update_post_meta( $post_id, 'mstw_cs_degree', 298 strip_tags( $_POST['mstw_cs_degree']) );363 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_degree', $_POST ) ) ); 299 364 300 365 update_post_meta( $post_id, 'mstw_cs_birth_date', 301 strip_tags( $_POST['mstw_cs_birth_date']) );366 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_birth_date', $_POST ) ) ); 302 367 303 368 update_post_meta( $post_id, 'mstw_cs_home_town', 304 strip_tags( $_POST['mstw_cs_home_town']) );369 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_home_town', $_POST ) ) ); 305 370 306 371 update_post_meta( $post_id, 'mstw_cs_high_school', 307 strip_tags( $_POST['mstw_cs_high_school']) );372 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_high_school', $_POST ) ) ); 308 373 309 374 update_post_meta( $post_id, 'mstw_cs_family', 310 strip_tags( $_POST['mstw_cs_family']) );375 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_family', $_POST ) ) ); 311 376 } 312 377 else if ( $typenow == 'staff_position' ) { 378 if ( false == wp_verify_nonce( $safeNonce, 'edit-staffs' ) ) { 379 die( esc_html__( "Irrecoverable error encountered saving data. Exiting.", 'coaching-staffs' ) ); 380 } 313 381 update_post_meta( $post_id, 'mstw_cs_position_coach', 314 strip_tags( $_POST['mstw_cs_position_coach']) );382 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_position_coach', $_POST ) ) ); 315 383 316 384 update_post_meta( $post_id, 'mstw_cs_display_order', 317 strip_tags( $_POST['mstw_cs_display_order']) );385 wp_strip_all_tags( mstw_safe_get( 'mstw_cs_display_order', $_POST ) ) ); 318 386 } 319 } 387 388 } //End: mstw_cs_save_meta_data( ) 320 389 321 390 … … 357 426 else { 358 427 $photo_file_url = plugins_url() . '/coaching-staffs/images/default-photo.jpg'; 359 echo '<img width="64" height="64" src="' . $photo_file_url . '" class="attachment-64x64 wp-post-image" alt="No photo available">'; 428 //echo '<img width="64" height="64" src="' . $photo_file_url . '" class="attachment-64x64 wp-post-image" alt="No photo available">'; 429 ?> 430 <img width="64" height="64" src="<?php echo esc_url( $photo_file_url ) ?>" class="attachment-64x64 wp-post-image" alt="No photo available"> 431 <?php 360 432 361 433 } … … 363 435 364 436 case 'experience' : 365 printf( '%s',get_post_meta( $post_id, 'mstw_cs_experience', true ) );437 echo esc_html( get_post_meta( $post_id, 'mstw_cs_experience', true ) ); 366 438 break; 367 439 368 440 case 'alma_mater' : 369 printf( '%s',get_post_meta( $post_id, 'mstw_cs_alma_mater', true ) );441 echo esc_html( get_post_meta( $post_id, 'mstw_cs_alma_mater', true ) ); 370 442 break; 371 443 372 444 373 445 case 'degree' : 374 printf( '%s',get_post_meta( $post_id, 'mstw_cs_degree', true ) );446 echo esc_html( get_post_meta( $post_id, 'mstw_cs_degree', true ) ); 375 447 break; 376 448 377 449 case 'birth_date' : 378 printf( '%s',get_post_meta( $post_id, 'mstw_cs_birth_date', true ) );450 echo esc_html( get_post_meta( $post_id, 'mstw_cs_birth_date', true ) ); 379 451 break; 380 452 381 453 case 'home_town' : 382 printf( '%s',get_post_meta( $post_id, 'mstw_cs_home_town', true ) );454 echo esc_html( get_post_meta( $post_id, 'mstw_cs_home_town', true ) ); 383 455 break; 384 456 385 457 case 'high_school' : 386 printf( '%s',get_post_meta( $post_id, 'mstw_cs_high_school', true ) );458 echo esc_html( get_post_meta( $post_id, 'mstw_cs_high_school', true ) ); 387 459 break; 388 460 389 461 case 'family' : 390 printf( '%s',nl2br( get_post_meta( $post_id, 'mstw_cs_family', true ) ) );462 echo wp_kses_post( nl2br( get_post_meta( $post_id, 'mstw_cs_family', true ) ) ); 391 463 break; 392 464 … … 429 501 $staffs[$key] = $staff->name; 430 502 } 431 echo implode( ' | ', $staffs);503 echo esc_html( implode( ' | ', $staffs ) ); 432 504 } 433 505 break; … … 435 507 case 'coach' : 436 508 $coach_id = get_post_meta( $post_id, 'mstw_cs_position_coach', true ); 437 printf( '%s',get_the_title( $coach_id ) );509 echo esc_html( get_the_title( $coach_id ) ); 438 510 break; 439 511 440 512 case 'experience' : 441 printf( '%s', get_post_meta( $post_id, 'mstw_cs_experience', true ) ); 513 //printf( '%s', get_post_meta( $post_id, 'mstw_cs_experience', true ) ); 514 echo esc_html( get_post_meta( $post_id, 'mstw_cs_experience', true ) ); 442 515 break; 443 516 … … 486 559 <?php //settings_errors(); ?> 487 560 <form action="options.php" method="post"> 561 <?php wp_nonce_field( 'display-settings', 'mstw-cs-nonce' ); ?> 488 562 <?php settings_fields( 'mstw_cs_settings_fields' ); ?> 489 563 <?php do_settings_sections( 'mstw-cs-display-settings' ); ?> 490 564 <p> 491 <input name="submit" type="submit" class="button-primary" value=<?php _e( "Save Changes", "coaching-staffs" ); ?> />565 <input name="submit" type="submit" class="button-primary" value=<?php esc_html_e( "Save Changes", "coaching-staffs" ); ?> /> 492 566 493 <input type="submit" name="mstw_cs_options[reset]" value=<?php _e( "Reset Default Values", "coaching-staffs" ) ?> />494 <strong><?php _e( "WARNING! Reset Default Values will do so without further warning!", "coaching-staffs" ); ?></strong>567 <input type="submit" name="mstw_cs_options[reset]" value=<?php esc_html_e( "Reset Default Values", "coaching-staffs" ) ?> /> 568 <strong><?php esc_html_e( "WARNING! Reset Default Values will do so without further warning!", "coaching-staffs" ); ?></strong> 495 569 </p> 496 570 </form> … … 505 579 506 580 function mstw_cs_admin_init( ){ 581 //mstw_log_msg( "mstw_cs_admin_init:" ); 582 507 583 $options = get_option( 'mstw_cs_options' ); 508 584 $options = wp_parse_args( $options, mstw_cs_get_defaults( ) ); 509 //print_r ($options);510 585 511 586 // Settings for the fields and columns display and label controls. … … 532 607 // Data field visibility and labels 533 608 function mstw_cs_data_fields_setup( ) { 609 //mstw_log_msg( "mstw_cs_data_fields_setup:" ); 610 534 611 $display_page = 'mstw-cs-display-settings'; //menu page slug on which to display 535 612 $page_section = 'mstw_cs_data_field_settings'; //page section slug on which to display 536 613 537 614 $options = get_option( 'mstw_cs_options' ); 538 615 539 616 add_settings_section( 540 617 $page_section, //id attribute of tags 541 __( 'Data Field Settings', 'coaching-staffs' ), //title of the section618 esc_html__( 'Data Field Settings', 'coaching-staffs' ), //title of the section 542 619 'mstw_cs_data_fields_settings_text', //callback to fill section with desired output - should echo 543 620 $display_page //page slug on which to display … … 560 637 ); 561 638 562 563 639 //Show/Hide Position 564 640 $args = array( 'id' => 'show_position', 565 641 'name' => 'mstw_cs_options[show_position]', 566 'value' => $options['show_position'],642 'value' => mstw_safe_get( 'show_position', $options, 1 ), 567 643 'label' => '' 568 644 ); … … 576 652 $args //Callback arguments 577 653 ); 578 579 580 654 581 655 //Position Label … … 598 672 $args = array( 'id' => 'show_experience', 599 673 'name' => 'mstw_cs_options[show_experience]', 600 'value' => $options['show_experience'],674 'value' => mstw_safe_get( 'show_experience', $options, 1 ), 601 675 'label' => '' 602 676 ); … … 630 704 $args = array( 'id' => 'show_alma_mater', 631 705 'name' => 'mstw_cs_options[show_alma_mater]', 632 'value' => $options['show_alma_mater'],706 'value' => mstw_safe_get( 'show_alma_mater', $options, 1 ), 633 707 'label' => '' 634 708 ); … … 662 736 $args = array( 'id' => 'show_degree', 663 737 'name' => 'mstw_cs_options[show_degree]', 664 'value' => $options['show_degree'],738 'value' => mstw_safe_get( 'show_degree', $options, 0 ), 665 739 'label' => '' 666 740 ); … … 694 768 $args = array( 'id' => 'show_birth_date', 695 769 'name' => 'mstw_cs_options[show_birth_date]', 696 'value' => $options['show_birth_date'],770 'value' => mstw_safe_get( 'show_birth_date', $options, 0 ), 697 771 'label' => '' 698 772 ); … … 726 800 $args = array( 'id' => 'show_home_town', 727 801 'name' => 'mstw_cs_options[show_home_town]', 728 'value' => $options['show_home_town'],802 'value' => mstw_safe_get( 'show_home_town', $options, 0 ), 729 803 'label' => '' 730 804 ); … … 758 832 $args = array( 'id' => 'show_high_school', 759 833 'name' => 'mstw_cs_options[show_high_school]', 760 'value' => $options['show_high_school'],834 'value' => mstw_safe_get( 'show_high_school', $options, 0 ), 761 835 'label' => '' 762 836 ); … … 771 845 ); 772 846 773 //H ometownLabel847 //High School Label 774 848 $args = array( 'id' => 'high_school_label', 775 849 'name' => 'mstw_cs_options[high_school_label]', … … 790 864 $args = array( 'id' => 'show_family', 791 865 'name' => 'mstw_cs_options[show_family]', 792 'value' => $options['show_family'],866 'value' => mstw_safe_get( 'show_family', $options, 0 ), 793 867 'label' => '' 794 868 ); … … 803 877 ); 804 878 805 // HometownLabel879 //Family Label 806 880 $args = array( 'id' => 'family_label', 807 881 'name' => 'mstw_cs_options[family_label]', … … 873 947 add_settings_field( 874 948 'table_title_color', 875 __( 'Table Title Color:', 'coaching-staffs' ),949 esc_html__( 'Table Title Color:', 'coaching-staffs' ), 876 950 'mstw_utl_color_ctrl', 877 951 $display_page, //Page to display field … … 884 958 'name' => 'mstw_cs_options[show_photos]', 885 959 //'value' => $options['show_photos'], //mstw_cs_admin_safe_ref( $options, 'show_photos' ), 886 'value' => mstw_cs_safe_ref( $options, 'show_photos' ),960 'value' => mstw_cs_safe_ref( $options, 'show_photos', 1 ), 887 961 'label' => __( 'Will show coaches photos in the staff tables', 'coaching-staffs') 888 962 ); … … 1090 1164 ); 1091 1165 1092 } 1166 } //End: mstw_cs_table_settings_setup( ) 1093 1167 1094 1168 // -------------------------------------------------------------------------------------- … … 1283 1357 ); 1284 1358 1359 $showGalleryTitle = mstw_safe_get( 'show_gallery_title', $options, 0 ); 1285 1360 // Show/Hide Gallery Title 1286 1361 $args = array( 'id' => 'show_gallery_title', 1287 1362 'name' => 'mstw_cs_options[show_gallery_title]', 1288 'value' => $ options['show_gallery_title'],1363 'value' => $showGalleryTitle, /*$options['show_gallery_title'],*/ 1289 1364 'label' => __( 'Will use "Staff Name" from Staff taxonomy as default. Hide to use another page element for the table title.', 'coaching-staffs') 1290 1365 ); 1291 1366 1292 1367 add_settings_field( 1293 1368 'show_gallery_title', … … 1316 1391 1317 1392 //Tile Corner Style 1393 $galleryTileRadius = mstw_safe_get( 'gagallery_tile_radius', $options, 0 ); 1318 1394 $args = array( 'id' => 'gallery_tile_radius', 1319 1395 'name' => 'mstw_cs_options[gallery_tile_radius]', 1320 'value' => $ options['gallery_tile_radius'],1396 'value' => $galleryTileRadius, /*$options['gallery_tile_radius'],*/ 1321 1397 'label' => __( 'Default is rounded.', 'coaching-staffs' ), 1322 1398 'options' => array( __( 'Rounded', 'coaching-staffs' ) => 15, … … 1400 1476 1401 1477 function mstw_cs_gallery_settings_text( ) { 1402 echo '<p>' . __( 'Enter the default settings for Coaches Gallery pages.', 'coaching-staffs' ) . '</p>';1478 echo '<p>' . esc_html__( 'Enter the default settings for Coaches Gallery pages.', 'coaching-staffs' ) . '</p>'; 1403 1479 } 1404 1480 1405 1481 function mstw_cs_profile_settings_text( ) { 1406 echo '<p>' . __( 'Enter the default settings for Single Coach Profile pages.', 'coaching-staffs' ) . '</p>';1482 echo '<p>' . esc_html__( 'Enter the default settings for Single Coach Profile pages.', 'coaching-staffs' ) . '</p>'; 1407 1483 } 1408 1484 1409 1485 function mstw_cs_table_settings_text( ) { 1410 echo '<p>' . __( 'Enter the default settings for Staff Table/[shortcode]. These can be overridden by [shortcode] arguments.', 'coaching-staffs' ) . '</p>';1486 echo '<p>' . esc_html__( 'Enter the default settings for Staff Table/[shortcode]. These can be overridden by [shortcode] arguments.', 'coaching-staffs' ) . '</p>'; 1411 1487 } 1412 1488 1413 1489 function mstw_cs_data_fields_settings_text( ) { 1414 echo '<p>' . __( 'Enter the visibility and labels for the data fiels. The name field must always be displayed, but it can be re-labeled. Note that these settings can be overridden by [shortcode] arguments.', 'coaching-staffs' ) . '</p>';1490 echo '<p>' . esc_html__( 'Enter the visibility and labels for the data fields. The name field must always be displayed, but it can be re-labeled. Note that these settings can be overridden by [shortcode] arguments.', 'coaching-staffs' ) . '</p>'; 1415 1491 } 1416 1492 1417 1493 function mstw_cs_validate_settings( $input ) { 1418 // Create our array for storing the validated options 1494 //mstw_log_msg( "mstw_cs_validate_settings:" ); 1495 1496 // array to store the validated options 1419 1497 $output = array(); 1498 1420 1499 // Pull the previous (good) options 1421 1500 $options = get_option( 'mstw_cs_options' ); … … 1423 1502 if ( array_key_exists( 'reset', $input ) ) { 1424 1503 if ( $input['reset'] ) { 1504 delete_option( 'mstw_cs_options' ); 1425 1505 $output = mstw_cs_get_defaults( ); 1426 1506 return $output; … … 1490 1570 case 'show_photos': 1491 1571 $output[$key] = ( isset( $input[$key] ) and $input[$key] == 1 ) ? 1 : 0; 1492 //mstw_log_msg( 'saving ' . $key . '... input= ' . $input[$key] . ' output= ' . $output[$key] );1493 1572 break; 1494 1573 … … 1504 1583 1505 1584 return $output; 1506 } 1507 1508 function mstw_cs_safe_ref( $array, $ref ) {1509 $foo = isset( $array[$ref] ) ? $array[$ref] : '';1585 } //End: mstw_cs_validate_settings( ) 1586 1587 function mstw_cs_safe_ref( $array, $ref, $default = '' ) { 1588 $foo = isset( $array[$ref] ) ? $array[$ref] : $default; 1510 1589 return $foo; 1511 1590 } … … 1564 1643 1565 1644 $messages['coach'] = array( 1645 /* translators: %s number of items */ 1566 1646 'updated' => _n( '%s coach updated.', '%s coaches updated.', $bulk_counts['updated'], 'coaching-staffs' ), 1647 /* translators: %s number of items */ 1567 1648 'locked' => _n( '%s coach not updated, somebody is editing it.', '%s coaches not updated, somebody is editing them.', $bulk_counts['locked'], 'coaching-staffs' ), 1649 /* translators: %s number of items */ 1568 1650 'deleted' => _n( '%s coach permanently deleted.', '%s coaches permanently deleted.', $bulk_counts['deleted'], 'coaching-staffs' ), 1651 /* translators: %s number of items */ 1569 1652 'trashed' => _n( '%s coach moved to the Trash.', '%s coaches moved to the Trash.', $bulk_counts['trashed'], 'coaching-staffs' ), 1653 /* translators: %s number of items */ 1570 1654 'untrashed' => _n( '%s coach restored from the Trash.', '%s coaches restored from the Trash.', $bulk_counts['untrashed'], 'coaching-staffs' ), 1571 1655 ); 1572 1656 1573 1657 $messages['staff_position'] = array( 1658 /* translators: %s number of items */ 1574 1659 'updated' => _n( '%s position updated.', '%s positions updated.', $bulk_counts['updated'], 'coaching-staffs' ), 1660 /* translators: %s number of items */ 1575 1661 'locked' => _n( '%s position not updated, somebody is editing it.', '%s positions not updated, somebody is editing them.', $bulk_counts['locked'], 'coaching-staffs' ), 1662 /* translators: %s number of items */ 1576 1663 'deleted' => _n( '%s position permanently deleted.', '%s positions permanently deleted.', $bulk_counts['deleted'], 'coaching-staffs' ), 1664 /* translators: %s number of items */ 1577 1665 'trashed' => _n( '%s position moved to the Trash.', '%s positions moved to the Trash.', $bulk_counts['trashed'], 'coaching-staffs' ), 1666 /* translators: %s number of items */ 1578 1667 'untrashed' => _n( '%s position restored from the Trash.', '%s positions restored from the Trash.', $bulk_counts['untrashed'], 'coaching-staffs' ), 1579 1668 ); -
coaching-staffs/trunk/includes/mstw-cs-utility-functions.php
r3215779 r3290731 34 34 // None. Outputs to WP error_log 35 35 // 36 if ( !function_exists( 'mstw_log_msg' ) ) {36 /*if ( !function_exists( 'mstw_log_msg' ) ) { 37 37 function mstw_log_msg( $msg ) { 38 38 if ( WP_DEBUG === true ) { … … 49 49 } //End: mstw_log_msg( ) 50 50 } 51 51 */ 52 52 //--------------------------------------------------------------------------------- 53 53 // 2. mstw_cs_get_defaults: returns the array of option defaults … … 74 74 'birth_date_label' => __( 'Born', 'coaching-staffs' ), 75 75 'show_birth_date' => 0, 76 'home_town_label' => __( 'Home town', 'coaching-staffs' ),76 'home_town_label' => __( 'Home Town', 'coaching-staffs' ), 77 77 'show_home_town' => 0, 78 78 'high_school_label' => __( 'High School', 'coaching-staffs' ), … … 130 130 } //End: mstw_cs_find_staff_position( ) 131 131 } 132 133 /*---------------------------------------------------------------------------------*/ 134 // 4. mstw_cs_build_coach_link_html: 135 // ARGUMENTS: 136 // RETURNS : 137 // 138 if ( !function_exists( 'mstw_cs_build_coach_link_html' ) ) { 139 function mstw_cs_build_coach_link_html( $coachURL, $coachDisplay ) { 140 //mstw_log_msg( "mstw_cs_build_coach_link_html:" ); 141 $coachHTML = '<a href="' . $coachURL . '">' . $coachDisplay . '</a>'; 142 143 return $coachHTML; 144 145 } //End: mstw_cs_build_coach_link_html( ) 146 } 147 148 /*---------------------------------------------------------------------------------*/ 149 // 4. mstw_cs_build_coach_url: 150 // ARGUMENTS: 151 // RETURNS : 152 // 153 if ( !function_exists( 'mstw_cs_build_coach_url' ) ) { 154 function mstw_cs_build_coach_url( $postID, $coachID ) { 155 //mstw_log_msg( "mstw_cs_build_coach_url:" ); 156 $nonceURL = wp_nonce_url( get_permalink( $coachID ), 'single-coach', 'mstw-cs-nonce' ); 157 $nonceURL .= '&position='. $postID; 158 159 return $nonceURL; 160 } //End: mstw_cs_build_coach_url() 161 } 162 163 /*--------------------------------------------------------------------------------- 164 // 4. mstw_cs_get_photo_url: returns url of post thumbnail or default photo 165 // ARGUMENTS: coach CPT object 166 // RETURNS : coach photo url 167 // 168 if ( !function_exists( 'mstw_cs_get_photo_url' ) ) { 169 170 function mstw_cs_get_photo_url( ) { 171 //mstw_log_msg( 'mstw_cs_get_photo_url:' ); 172 173 // check if the post has a Post Thumbnail assigned to it. 174 if ( has_post_thumbnail( ) ) { //defaults to current post 175 //Get the photo file; 176 $photo_file_url = wp_get_attachment_thumb_url( get_post_thumbnail_id( 177 // defaults to current post 178 $alt = 'Photo of ' . $name; 179 } else { 180 // Default image is tied to the staff taxonomy. 181 // Try to load default-photo-staff-slug.jpg, If it does not exst, 182 // Then load default-photo.jpg from the plugin --> 183 $photo_file = WP_PLUGIN_DIR . '/coaching-staffs/images/default-photo' . '-' . $staff_slug . '.jpg'; 184 if ( file_exists( $photo_file ) ) { 185 $photo_file_url = plugins_url() . '/coaching-staffs/images/default-photo' . '-' . $staff_slug . '.jpg'; 186 $alt = __( 'Default image for', 'coaching-staffs') . ' ' . $staff_slug; 187 } 188 else { 189 $photo_file_url = plugins_url() . '/coaching-staffs/images/default-photo' . '.jpg'; 190 $alt = __( 'Photo not found.', 'coaching-staffs' ); 191 } 192 } 193 } // End: mstw_cs_get_photo_url( ) 194 } 195 */ 132 196 ?> -
coaching-staffs/trunk/includes/mstw-utility-functions.php
r3215779 r3290731 5 5 * 6 6 * MSTW Wordpress Plugins (http://shoalsummitsolutions.com) 7 * Copyright 2014-2 4Mark O'Donnell ([email protected])7 * Copyright 2014-25 Mark O'Donnell ([email protected]) 8 8 * 9 9 * This program is free software: you can redistribute it and/or modify … … 26 26 * 1. mstw_log_msg - writes debug messages to /wp-content/debug.log 27 27 * if the WP_DEBUG settings in wp-config are correct 28 * 2. mstw_requires_wordpress_version - checks for the right WordPress version28 * 2. mstw_requires_wordpress_version - removed from coaching staffs 29 29 * 3. mstw_safe_ref - prevents uninitialized string errors 30 30 * 3. mstw_safe_get - Safely get value for a key from an array … … 60 60 // None. Outputs to WP error_log 61 61 // 62 /* 63 * ABOUT THE PLUGIN CHECKER TOOL COMPLAINTS: 64 * This 'debug' code is included in production code to provide hints to system 65 * admistrators about possible(rare) problems. It's used for debugging in development. 66 */ 62 67 if ( !function_exists( 'mstw_log_msg' ) ) { 63 68 function mstw_log_msg( $msg ) { … … 84 89 // THIS FUNCTION ONLY WORKS IN ADMIN (because it calls get_plugin_data() 85 90 // 86 if ( !function_exists( 'mstw_requires_wordpress_version' ) ) { 87 function mstw_requires_wordpress_version( $version = '3.9.2' ) { 88 global $wp_version; 89 90 $plugin = MSTW_SS_PLUGIN_NAME; 91 //$plugin_data = get_plugin_data( __FILE__, false ); 92 $plugin_data = get_plugin_data( MSTW_SS_PLUGIN_DIR . '/mstw-schedules-scoreboards.php', 93 false ); 94 95 if ( version_compare( $wp_version, $version, "<" ) ) { 96 if( is_plugin_active( $plugin ) ) { 97 deactivate_plugins( $plugin ); 98 $die_msg = $plugin_data['Name'] . " requires WordPress $version or higher, and has been deactivated! <br/> Please upgrade WordPress and try again.<br /><br /><a href='".admin_url()."'>Back to admin dashboard</a>."; 99 die( $die_msg ); 100 } 101 } 102 } //end mstw_requires_wordpress_version() 103 } 104 91 /* 92 * Removed from coaching staffs plugins 93 */ 94 105 95 // ---------------------------------------------------------------- 106 96 // 3. mstw_safe_ref - prevents uninitialized string errors … … 130 120 if ( !function_exists ( 'mstw_safe_get' ) ) { 131 121 function mstw_safe_get( $needle, $haystack, $default = '' ) { 132 //mstw_log_msg( "mstw_safe_get: needle= $needle" ); 133 //mstw_log_msg( $haystack ); 122 //mstw_log_msg( "mstw_safe_get: needle= $needle" haystack= $haystack" ); 134 123 135 124 if ( array_key_exists( $needle, $haystack ) ) { … … 180 169 function mstw_date_loc($format, $timestamp = null) { 181 170 $param_D = array( '', 182 __( 'Mon', ' mstw-loc-domain' ),183 __( 'Tue', ' mstw-loc-domain' ),184 __( 'Wed', ' mstw-loc-domain' ),185 __( 'Thr', ' mstw-loc-domain' ),186 __( 'Fri', ' mstw-loc-domain' ),187 __( 'Sat', ' mstw-loc-domain' ),188 __( 'Sun', ' mstw-loc-domain' ) );171 __( 'Mon', 'coaching-staffs' ), 172 __( 'Tue', 'coaching-staffs' ), 173 __( 'Wed', 'coaching-staffs' ), 174 __( 'Thr', 'coaching-staffs' ), 175 __( 'Fri', 'coaching-staffs' ), 176 __( 'Sat', 'coaching-staffs' ), 177 __( 'Sun', 'coaching-staffs' ) ); 189 178 190 179 $param_l = array( '', 191 __( 'Monday', ' mstw-loc-domain' ),192 __( 'Tuesday', ' mstw-loc-domain' ),193 __( 'Wednesday', ' mstw-loc-domain' ),194 __( 'Thursday', ' mstw-loc-domain' ),195 __( 'Friday', ' mstw-loc-domain' ),196 __( 'Saturday', ' mstw-loc-domain' ),197 __( 'Sunday', ' mstw-loc-domain' ) );180 __( 'Monday', 'coaching-staffs' ), 181 __( 'Tuesday', 'coaching-staffs' ), 182 __( 'Wednesday', 'coaching-staffs' ), 183 __( 'Thursday', 'coaching-staffs' ), 184 __( 'Friday', 'coaching-staffs' ), 185 __( 'Saturday', 'coaching-staffs' ), 186 __( 'Sunday', 'coaching-staffs' ) ); 198 187 199 188 $param_F = array( '', 200 __( 'January', ' mstw-loc-domain' ),201 __( 'February', ' mstw-loc-domain' ),202 __( 'March', ' mstw-loc-domain' ),203 __( 'April', ' mstw-loc-domain' ),204 __( 'May', ' mstw-loc-domain' ),205 __( 'June', ' mstw-loc-domain' ),206 __( 'July', ' mstw-loc-domain' ),207 __( 'August', ' mstw-loc-domain' ),208 __( 'September', ' mstw-loc-domain' ),209 __( 'October', ' mstw-loc-domain' ),210 __( 'November', ' mstw-loc-domain' ),211 __( 'December', ' mstw-loc-domain' ) );189 __( 'January', 'coaching-staffs' ), 190 __( 'February', 'coaching-staffs' ), 191 __( 'March', 'coaching-staffs' ), 192 __( 'April', 'coaching-staffs' ), 193 __( 'May', 'coaching-staffs' ), 194 __( 'June', 'coaching-staffs' ), 195 __( 'July', 'coaching-staffs' ), 196 __( 'August', 'coaching-staffs' ), 197 __( 'September', 'coaching-staffs' ), 198 __( 'October', 'coaching-staffs' ), 199 __( 'November', 'coaching-staffs' ), 200 __( 'December', 'coaching-staffs' ) ); 212 201 213 202 $param_M = array( '', 214 __( 'Jan', ' mstw-loc-domain' ),215 __( 'Feb', ' mstw-loc-domain' ),216 __( 'Mar', ' mstw-loc-domain' ),217 __( 'Apr', ' mstw-loc-domain' ),218 __( 'May', ' mstw-loc-domain' ),219 __( 'Jun', ' mstw-loc-domain' ),220 __( 'Jul', ' mstw-loc-domain' ),221 __( 'Aug', ' mstw-loc-domain' ),222 __( 'Sep', ' mstw-loc-domain' ),223 __( 'Oct', ' mstw-loc-domain' ),224 __( 'Nov', ' mstw-loc-domain' ),225 __( 'Dec', ' mstw-loc-domain' ) );203 __( 'Jan', 'coaching-staffs' ), 204 __( 'Feb', 'coaching-staffs' ), 205 __( 'Mar', 'coaching-staffs' ), 206 __( 'Apr', 'coaching-staffs' ), 207 __( 'May', 'coaching-staffs' ), 208 __( 'Jun', 'coaching-staffs' ), 209 __( 'Jul', 'coaching-staffs' ), 210 __( 'Aug', 'coaching-staffs' ), 211 __( 'Sep', 'coaching-staffs' ), 212 __( 'Oct', 'coaching-staffs' ), 213 __( 'Nov', 'coaching-staffs' ), 214 __( 'Dec', 'coaching-staffs' ) ); 226 215 227 216 $return = ''; … … 238 227 break; 239 228 case 'D' : 240 $return .= $param_D[ date('N', $timestamp)];229 $return .= $param_D[gmdate('N', $timestamp)]; 241 230 break; 242 231 case 'l' : 243 $return .= $param_l[ date('N', $timestamp)];232 $return .= $param_l[gmdate('N', $timestamp)]; 244 233 break; 245 234 case 'F' : 246 $return .= $param_F[ date('n', $timestamp)];235 $return .= $param_F[gmdate('n', $timestamp)]; 247 236 break; 248 237 case 'M' : 249 $return .= $param_M[ date('n', $timestamp)];238 $return .= $param_M[gmdate('n', $timestamp)]; 250 239 break; 251 240 default : 252 $return .= date($format[$i], $timestamp);241 $return .= gmdate($format[$i], $timestamp); 253 242 break; 254 243 } … … 269 258 // 'curr_value' => current field value, 270 259 // 'options' => array of options in key=>value pairs 271 // e.g., array( __( '08:00 (24hr)', ' mstw-loc-domain' ) => 'H:i', ... )260 // e.g., array( __( '08:00 (24hr)', 'coaching-staffs' ) => 'H:i', ... ) 272 261 // 'label_for' => $id, 273 262 // 'class' => $class, … … 275 264 // ); 276 265 // 277 if( !function_exists( 'mstw_build_admin_edit_screen' ) ) { 278 function mstw_build_admin_edit_screen( $fields ) { 279 280 foreach( $fields as $field_id=>$field_data ) { 281 //HANDLE table dividers here ... NEW 282 if ( $field_data['type'] == 'divider' ) { 283 $divider_msg = ( isset( $field_data['curr_value'] ) ) ? $field_data['curr_value'] : ' '; 284 ?> 285 <tr class='mstw-divider-spacer'><td> </td></tr> 286 <tr class='mstw-divider'><th colspan=2 ><?php echo $divider_msg ?></th></tr> 287 <?php 288 } 289 else { 290 $field_data['id'] = ( !isset( $field_data['id'] ) || empty( $field_data['id'] ) ) ? $field_id : $field_data['id']; 291 $field_data['name'] = ( !isset( $field_data['name'] ) || empty( $field_data['name'] ) ) ? $field_id : $field_data['name']; 292 293 // check the field label/title 294 if ( array_key_exists( 'label', $field_data ) && !empty( $field_data['label'] ) ) 295 $label = $field_data['label']; 296 else 297 $label = ''; 298 ?> 299 300 <tr> 301 <th><label for '<?php echo $field_data['id']?>' > 302 <?php echo $label ?> 303 </label></th> 304 <?php 305 // media-uploader will add it's own cells (3 of theme) 306 if ( $field_data['type'] != 'media-uploader' ) { 307 echo "<td>\n"; 308 } 309 310 311 mstw_build_admin_edit_field( $field_data ); 312 313 if ( $field_data['type'] != 'media-uploader' ) { 314 echo "</td>\n"; 315 } 316 ?> 317 </tr> 318 <?php 319 } 320 } 321 322 } //End: mstw_build_admin_edit_screen() 323 } 266 /* 267 * Removed from cuaching staffs plugin version 268 */ 324 269 325 270 //------------------------------------------------------------------------------- … … 333 278 // 'curr_value' => current field value, 334 279 // 'options' => array of options in key=>value pairs 335 // e.g., array( __( '08:00 (24hr)', ' mstw-loc-domain' ) => 'H:i', ... )280 // e.g., array( __( '08:00 (24hr)', 'coaching-staffs' ) => 'H:i', ... ) 336 281 // 'label_for' => $id, 337 282 // 'class' => $class, … … 340 285 // 341 286 // 342 if( !function_exists( 'mstw_build_admin_edit_field' ) ) { 343 function mstw_build_admin_edit_field( $args ) { 344 345 $defaults = array( 346 'type' => 'text', 347 'id' => 'default_field', // the ID of the setting in our options array, and the ID of the HTML form element 348 'title' => __( 'Default Field', 'mstw-loc-domain' ), // the label for the HTML form element 349 'label' => __( 'Default Label', 'mstw-loc-domain' ), // the label for the HTML form element 350 'desc' => '', // the description displayed under the HTML form element 351 'default' => '', // the default value for this setting 352 'type' => 'text', // the HTML form element to use 353 'options' => array(), // (optional): the values in radio buttons or a drop-down menu 354 'name' => '', //name of HTML form element. should be options_array[option] 355 'class' => '', // the HTML form element class. Also used for validation purposes! 356 'curr_value' => '', // the current value of the setting 357 'maxlength' => '', // maxlength attrib of some input controls 358 'size' => '', // size attrib of some input controls 359 'img_width' => 60, 360 'btn_label' => 'Upload from Media Library', 361 ); 362 363 // "extract" to be able to use the array keys as variables in our function output below 364 $args = wp_parse_args( $args, $defaults ); 365 366 extract( $args ); 367 368 // default name to id 369 $name = ( !empty( $name ) ) ? $name : $id; 370 371 // pass the standard value if the option is not yet set in the database 372 //if ( !isset( $options[$id] ) && $options[ != 'checkbox' && ) { 373 // $options[$id] = ( isset( $default ) ? $default : 'default_field' ); 374 //} 375 376 // Additional field class. Output only if the class is defined in the $args() 377 $class_str = ( !empty( $class ) ) ? "class='$class'" : '' ; 378 $maxlength_str = ( !empty( $maxlength ) ) ? "maxlength='$maxlength'" : '' ; 379 $size_str = ( !empty( $size ) ) ? "size='$size'" : '' ; 380 $attrib_str = " $class_str $maxlength_str $size_str "; 381 382 // switch html display based on the setting type. 383 switch ( $args['type'] ) { 384 //TEXT & COLOR CONTROLS 385 case 'text': // this is the default type 386 case 'color': // color field is just a text field with associated JavaScript 387 ?> 388 <input type="text" id="<?php echo $id ?>" name="<?php echo $name ?>" value="<?php echo $curr_value ?>" <?php echo $attrib_str ?> /> 389 <?php 390 echo ( !empty( $desc ) ) ? "<br /><span class='description'>$desc</span>\n" : ""; 391 break; 392 393 //SELECT OPTION CONTROL 394 case 'select-option': 395 //not sure why this is needed given the extract() above 396 //but without it you get an extra option with the 397 //'option-name' displayed (huh??) 398 $options = $args['options']; 399 400 echo "<select id='$id' name='$name' $attrib_str >"; 401 foreach( $options as $key=>$value ) { 402 $selected = ( $curr_value == $value ) ? 'selected="selected"' : ''; 403 echo "<option value='$value' $selected>$key</option>"; 404 } 405 echo "</select>"; 406 echo ( !empty( $desc ) ) ? "<br /><span class='description'>$desc</span>" : ""; 407 break; 408 409 // CHECKBOX 410 case 'checkbox': 411 echo "<input class='checkbox $class_str' type='checkbox' id='$id' name='$name' value=1 " . checked( $curr_value, 1, false ) . " />"; 412 echo ($desc != '') ? "<br /><span class='description'>$desc</span>" : ""; 413 break; 414 415 // LABEL 416 case 'label': 417 echo "<span class='description'>" . $curr_value . "</span>"; 418 echo ( '' != $desc ) ? "<br /><span class='description'>$desc</span>" : ""; 419 break; 420 421 // MEDIA UPLOADER 422 case 'media-uploader': 423 ?> 424 <td class="uploader"> 425 <input type="text" name="<?php echo $id ?>" id="<?php echo $id ?>" class="mstw_logo_text" size="32" value="<?php echo $curr_value ?>"/> 426 <?php echo ($desc != '') ? "<br /><span class='description'>$desc</span>" : ""; ?> 427 </td> 428 429 <td class="uploader"> 430 <input type="button" class="button" name="<?php echo $id . '_btn'?>" id="<?php echo $id . '_btn'?>" value="<?php echo $btn_label ?>" /> 431 <!-- </div> --> 432 </td> 433 <td> 434 <img id="<?php echo $id . '_img' ?>" width="<?php echo $img_width ?>" src="<?php echo $curr_value ?>" /> 435 </td> 436 <?php 437 break; 438 439 440 //--------------------------------------------------------------- 441 // THE FOLLOWING CASES HAVE NOT BEEN TESTED/USED 442 443 case "multi-text": 444 foreach($options as $item) { 445 $item = explode("|",$item); // cat_name|cat_slug 446 $item[0] = esc_html__($item[0], 'wptuts_textdomain'); 447 if (!empty($options[$id])) { 448 foreach ($options[$id] as $option_key => $option_val){ 449 if ($item[1] == $option_key) { 450 $value = $option_val; 451 } 452 } 453 } else { 454 $value = ''; 455 } 456 echo "<span>$item[0]:</span> <input class='$field_class' type='text' id='$id|$item[1]' name='" . $wptuts_option_name . "[$id|$item[1]]' value='$value' /><br/>"; 457 } 458 echo ($desc != '') ? "<span class='description'>$desc</span>" : ""; 459 break; 460 461 case 'textarea': 462 $options[$id] = stripslashes($options[$id]); 463 $options[$id] = esc_html( $options[$id]); 464 echo "<textarea class='textarea$field_class' type='text' id='$id' name='" . $wptuts_option_name . "[$id]' rows='5' cols='30'>$options[$id]</textarea>"; 465 echo ($desc != '') ? "<br /><span class='description'>$desc</span>" : ""; 466 break; 467 468 case 'select2': 469 echo "<select id='$id' class='select$field_class' name='" . $wptuts_option_name . "[$id]'>"; 470 foreach($options as $item) { 471 472 $item = explode("|",$item); 473 $item[0] = esc_html($item[0], 'wptuts_textdomain'); 474 475 $selected = ($options[$id]==$item[1]) ? 'selected="selected"' : ''; 476 echo "<option value='$item[1]' $selected>$item[0]</option>"; 477 } 478 echo "</select>"; 479 echo ($desc != '') ? "<br /><span class='description'>$desc</span>" : ""; 480 break; 481 482 case "multi-checkbox": 483 foreach($options as $item) { 484 485 $item = explode("|",$item); 486 $item[0] = esc_html($item[0], 'wptuts_textdomain'); 487 488 $checked = ''; 489 490 if ( isset($options[$id][$item[1]]) ) { 491 if ( $options[$id][$item[1]] == 'true') { 492 $checked = 'checked="checked"'; 493 } 494 } 495 496 echo "<input class='checkbox$field_class' type='checkbox' id='$id|$item[1]' name='" . $wptuts_option_name . "[$id|$item[1]]' value='1' $checked /> $item[0] <br/>"; 497 } 498 echo ($desc != '') ? "<br /><span class='description'>$desc</span>" : ""; 499 break; 500 501 default: 502 mstw_log_msg( "CONTROL TYPE $type NOT RECOGNIZED." ); 503 echo "CONTROL TYPE $type NOT RECOGNIZED."; 504 break; 505 506 } 507 } //End: mstw_build_admin_edit_field() 508 } 509 287 /* 288 * Removed from cuaching staffs plugin version 289 */ 510 290 //------------------------------------------------------------------------------- 511 291 // 8. mstw_build_settings_screen - builds admin settings form (using settings api) … … 515 295 // None. HTML is ouput/echoed to the screen by mstw_build_settings_field() 516 296 // 517 if( !function_exists( 'mstw_build_settings_screen' ) ) { 518 function mstw_build_settings_screen( $arguments ) { 519 foreach ( $arguments as $args ) { 520 mstw_build_settings_field( $args ); 521 } 522 } //End: mstw_build_settings_screen() 523 } 297 /* 298 * Removed from coaching staffs version 299 */ 524 300 525 301 //------------------------------------------------------------------------------- … … 532 308 // None. HTML is output/echoed to screen 533 309 // 534 if( !function_exists( 'mstw_build_settings_field' ) ) { 535 function mstw_build_settings_field( $args ) { 536 // default array to overwrite when calling the function 537 538 $defaults = array( 539 'id' => 'default_field', // the ID of the setting in our options array, and the ID of the HTML form element 540 'title' => 'Default Field', // the label for the HTML form element 541 'desc' => '', // the description displayed under the HTML form element 542 'default' => '', // the default value for this setting 543 'type' => 'text', // the HTML form element to use 544 'section' => '', // settings section to which this setting belongs 545 'page' => '', //page on which the section belongs 546 'options' => array(), // (optional): the values in radio buttons or a drop-down menu 547 'name' => '', //name of HTML form element. should be options_array[option] 548 'class' => '', // the HTML form element class. Also used for validation purposes! 549 'value' => '' // the current value of the setting 550 ); 551 552 // ARGUMENTS: $field_args = array( 553 // 'type' => $type, * 554 // 'id' => $id, * 555 // 'desc' => $desc, * 556 // 'curr_value' => $value, * 557 // 'options' => $options, * 558 // 'label_for' => $id, * (use id) 559 // 'class' => $class, * 560 // 'name' => $name, 561 // ); 562 563 // "extract" to be able to use the array keys as variables in our function output below 564 extract( wp_parse_args( $args, $defaults ) ); 565 566 //Handle some MSTW custom field types; convert for generic select-option 567 switch ( $type ) { 568 case 'show-hide': 569 $type = 'select-option'; 570 $options = array( __( 'Show', 'mstw-loc-domain' ) => 1, 571 __( 'Hide', 'mstw-loc-domain' ) => 0, 572 ); 573 break; 574 case 'date-time': 575 $type = 'select-option'; 576 577 $options = array ( __( 'Custom', 'mstw-loc-domain' ) => 'custom', 578 __( 'Tuesday, 07 April 01:15 pm', 'mstw-loc-domain' ) => 'l, d M h:i a', 579 __( 'Tuesday, 7 April 01:15 pm', 'mstw-loc-domain' ) => 'l, j M h:i a', 580 __( 'Tuesday, 07 April 1:15 pm', 'mstw-loc-domain' ) => 'l, d M g:i a', 581 __( 'Tuesday, 7 April 1:15 pm', 'mstw-loc-domain' ) => 'l, j M g:i a', 582 __( 'Tuesday, 7 April 13:15', 'mstw-loc-domain' ) => 'l, d M H:i', 583 __( 'Tuesday, 7 April 13:15', 'mstw-loc-domain' ) => 'l, j M H:i', 584 __( '07 April 13:15', 'mstw-loc-domain' ) => 'd M H:i', 585 __( '7 April 13:15', 'mstw-loc-domain' ) => 'j M H:i', 586 __( '07 April 01:15 pm', 'mstw-loc-domain' ) => 'd M g:i a', 587 __( '7 April 01:15 pm', 'mstw-loc-domain' ) => 'j M g:i a', 588 ); 589 590 if ( isset( $custom_format ) && $custom_format == 0 ) { 591 //remove the custom option 592 unset( $options[ __( 'Custom', 'mstw_loc_domain' ) ] ); 593 } 594 595 if ( $desc == '' ) { 596 $desc = __( 'Formats for 7 April 2013 13:15.', 'mstw-loc-domain' ); 597 } 598 599 break; 600 case 'date-only': 601 $type = 'select-option'; 602 $options = array ( __( 'Custom', 'mstw-loc-domain' ) => 'custom', 603 '2013-04-07' => 'Y-m-d', 604 '13-04-07' => 'y-m-d', 605 '04/07/13' => 'm/d/y', 606 '4/7/13' => 'n/j/y', 607 __( '07 Apr 2013', 'mstw-loc-domain' ) => 'd M Y', 608 __( '7 Apr 2013', 'mstw-loc-domain' ) => 'j M Y', 609 __( 'Tues, 07 Apr 2013', 'mstw-loc-domain' ) => 'D, d M Y', 610 __( 'Tues, 7 Apr 13', 'mstw-loc-domain' ) => 'D, j M y', 611 __( 'Tuesday, 7 Apr', 'mstw-loc-domain' ) => 'l, j M', 612 __( 'Tuesday, 07 April 2013', 'mstw-loc-domain' ) => 'l, d F Y', 613 __( 'Tuesday, 7 April 2013', 'mstw-loc-domain' ) => 'l, j F Y', 614 __( 'Tues, 07 Apr', 'mstw-loc-domain' ) => 'D, d M', 615 __( 'Tues, 7 Apr', 'mstw-loc-domain' ) => 'D, j M', 616 __( '07 Apr', 'mstw-loc-domain' ) => 'd M', 617 __( '7 Apr', 'mstw-loc-domain' ) => 'j M', 618 ); 619 620 if ( isset( $custom_format ) && $custom_format == 0 ) { 621 //remove the custom option 622 unset( $options[ __( 'Custom', 'mstw_loc_domain' ) ] ); 623 } 624 if ( $desc == '' ) { 625 $desc = __( 'Formats for 7 Apr 2013. Default: 2013-04-07', 'mstw-loc-domain' ); 626 } 627 break; 628 case 'time-only': 629 $type = 'select-option'; 630 $options = array ( __( 'Custom', 'mstw-loc-domain' ) => 'custom', 631 __( '08:00 (24hr)', 'mstw-loc-domain' ) => 'H:i', 632 __( '8:00 (24hr)', 'mstw-loc-domain' ) => 'G:i', 633 __( '08:00 am', 'mstw-loc-domain' ) => 'h:i a', 634 __( '08:00 AM', 'mstw-loc-domain' ) => 'h:i A', 635 __( '8:00 am', 'mstw-loc-domain' ) => 'g:i a', 636 __( '8:00 AM', 'mstw-loc-domain' ) => 'g:i A', 637 ); 638 639 if ( isset( $custom_format ) && $custom_format == 0 ) { 640 //remove the custom option 641 unset( $options[ __( 'Custom', 'mstw_loc_domain' ) ] ); 642 } 643 if ( $desc == '' ) { 644 $desc = __( 'Formats for eight in the morning. Default: 08:00', 'mstw-loc-domain' ); 645 } 646 break; 647 default: 648 break; 649 650 } 651 652 // 653 // map arguments used by mstw_display_form_field() to create HTML output 654 // 655 $field_args = array( 656 'type' => $type, 657 'id' => $id, 658 'desc' => $desc, 659 'curr_value' => $value, 660 'options' => $options, 661 'label_for' => $id, 662 'class' => $class, 663 'name' => $name, 664 ); 665 666 add_settings_field( $id, 667 $title, 668 'mstw_build_admin_edit_field', 669 $page, 670 $section, 671 $field_args 672 ); 673 674 } //End: mstw_build_settings_field() 675 } 310 /* 311 * Removed from coaching staffs version 312 */ 676 313 677 314 //------------------------------------------------------------------------------- … … 734 371 } 735 372 else { 736 //mstw_log_msg( 'in mstw_validate_url ... got a bad URL: ' . $url );737 373 // url is not valid, display an error message (dont' update DB) 738 374 $notice .= ' ' . $url; … … 744 380 } 745 381 746 / /-------------------------------------------------------------------------------382 /*//------------------------------------------------------------------------------- 747 383 // 13. mstw_get_current_post_type - get the current post type in the WordPress Admin 748 384 // ARGUMENTS: … … 765 401 elseif( $current_screen and $current_screen->post_type ) 766 402 return $current_screen->post_type; 767 403 /** 404 * IDK how to fix the warning from the plugin checker: 405 * Processing form data without nonce verification. 406 * This utility function is just trying to find a post type?? 407 768 408 elseif( isset( $_REQUEST['post_type'] ) ) 769 409 return sanitize_key( $_REQUEST['post_type'] ); … … 774 414 } //End: mstw_get_current_post_type( ) 775 415 } 416 */ 776 417 777 418 //------------------------------------------------------------------------------- … … 869 510 $msg_type = ( $msg_type == 'warning' ) ? $msg_type . ' updated' : $msg_type ; 870 511 ?> 871 <div class="<?php echo $msg_type; ?>">872 <p><?php echo $msg_notice; ?></p>512 <div class="<?php echo esc_html( $msg_type ); ?>"> 513 <p><?php echo esc_html( $msg_notice ); ?></p> 873 514 </div> 874 515 … … 892 533 // 893 534 if ( !function_exists ( 'mstw_add_admin_notice' ) ) { 894 function mstw_add_admin_notice( $transient = 'mstw_admin_messages', $type = 'updated', $notice ) { 535 function mstw_add_admin_notice( $transient = 'mstw_admin_messages', $type = 'updated', $notice = "" ) { 536 /** 537 * 20250130: changed required arg $notice to optional to stop annoying 538 * PHP warnings that started with PHP 8 539 */ 540 895 541 //default type to 'updated' 896 542 if ( !( $type == 'updated' or $type == 'error' or $type =='update-nag' or $type == 'warning' ) ) $type = 'updated'; … … 936 582 // 937 583 if( function_exists( 'mstw_add_role_caps' ) ) { 938 function mstw_add_role_caps( $role_obj = null, $role_name = null, $cpt, $cpt_s ) { 939 584 function mstw_add_role_caps( $role_obj = null, $role_name = null, $cpt = null, $cpt_s = null ) { 585 586 /** 587 * 20250130: changed required args $cpt & $cpt_s to optional to stop annoying 588 * PHP warnings that started with PHP 8 589 */ 940 590 $cap = array( 'edit_', 'read_', 'delete_' ); 941 591 $caps = array( 'edit_', 'edit_others_', 'publish_', 'read_private_', 'delete_', 'delete_published_', 'delete_others_', 'edit_private_', 'edit_published_' ); -
coaching-staffs/trunk/lang/mstw-coaching-staffs-en_US.pot
r3215779 r3290731 3 3 msgstr "" 4 4 "Project-Id-Version: MSTW Coaching Staffs\n" 5 "POT-Creation-Date: 202 4-12-30 14:08-0600\n"5 "POT-Creation-Date: 2025-05-07 13:58-0500\n" 6 6 "PO-Revision-Date: 2015-01-23 20:31-0800\n" 7 7 "Last-Translator: \n" … … 12 12 "Content-Transfer-Encoding: 8bit\n" 13 13 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 14 "X-Generator: Poedit 3. 5\n"14 "X-Generator: Poedit 3.6\n" 15 15 "X-Poedit-Basepath: .\n" 16 16 "X-Poedit-KeywordsList: __;_e\n" … … 19 19 "X-Poedit-SearchPath-2: ../theme-templates\n" 20 20 21 #: ../includes/mstw-admin-utils.php:138 22 #: ../includes/mstw-utility-functions.php:570 21 #: ../includes/mstw-admin-utils.php:167 23 22 msgid "Show" 24 23 msgstr "" 25 24 26 #: ../includes/mstw-admin-utils.php:139 27 #: ../includes/mstw-utility-functions.php:571 25 #: ../includes/mstw-admin-utils.php:168 28 26 msgid "Hide" 29 27 msgstr "" 30 28 31 #: ../includes/mstw-coaching-staffs-admin.php:129 32 msgid "Show All Staffs" 33 msgstr "" 34 35 #: ../includes/mstw-coaching-staffs-admin.php:163 36 msgid "Show All " 37 msgstr "" 38 39 #: ../includes/mstw-coaching-staffs-admin.php:202 40 #: ../includes/mstw-coaching-staffs-admin.php:462 29 #: ../includes/mstw-coaching-staffs-admin.php:157 30 msgid "Coach Data" 31 msgstr "" 32 33 #: ../includes/mstw-coaching-staffs-admin.php:176 34 msgid "Staff Position" 35 msgstr "" 36 37 #: ../includes/mstw-coaching-staffs-admin.php:399 38 #: ../includes/mstw-cs-utility-functions.php:65 39 msgid "Name" 40 msgstr "" 41 42 #: ../includes/mstw-coaching-staffs-admin.php:400 43 #: ../includes/mstw-cs-utility-functions.php:64 44 msgid "Photo" 45 msgstr "" 46 47 #: ../includes/mstw-coaching-staffs-admin.php:401 48 #: ../includes/mstw-cs-utility-functions.php:70 49 #: ../theme-templates/taxonomy-staffs.php:179 50 msgid "Alma Mater" 51 msgstr "" 52 53 #: ../includes/mstw-coaching-staffs-admin.php:402 54 #: ../includes/mstw-cs-utility-functions.php:68 55 #: ../theme-templates/taxonomy-staffs.php:169 56 msgid "Experience" 57 msgstr "" 58 59 #: ../includes/mstw-coaching-staffs-admin.php:403 60 #: ../includes/mstw-cs-utility-functions.php:72 61 #: ../theme-templates/taxonomy-staffs.php:189 62 msgid "Degree" 63 msgstr "" 64 65 #: ../includes/mstw-coaching-staffs-admin.php:404 66 msgid "Birth Date" 67 msgstr "" 68 69 #: ../includes/mstw-coaching-staffs-admin.php:405 70 #: ../includes/mstw-cs-utility-functions.php:76 71 #: ../theme-templates/taxonomy-staffs.php:209 72 msgid "Home Town" 73 msgstr "" 74 75 #: ../includes/mstw-coaching-staffs-admin.php:406 76 #: ../includes/mstw-cs-utility-functions.php:78 77 #: ../theme-templates/taxonomy-staffs.php:219 78 msgid "High School" 79 msgstr "" 80 81 #: ../includes/mstw-coaching-staffs-admin.php:407 82 #: ../includes/mstw-cs-utility-functions.php:80 83 #: ../theme-templates/taxonomy-staffs.php:229 84 msgid "Family" 85 msgstr "" 86 87 #: ../includes/mstw-coaching-staffs-admin.php:479 88 #: ../includes/mstw-cs-utility-functions.php:66 89 msgid "Position" 90 msgstr "" 91 92 #: ../includes/mstw-coaching-staffs-admin.php:480 93 msgid "Staff" 94 msgstr "" 95 96 #: ../includes/mstw-coaching-staffs-admin.php:482 41 97 msgid "Coach" 42 98 msgstr "" 43 99 44 #: ../includes/mstw-coaching-staffs-admin.php:209 45 msgid "Staff Position" 46 msgstr "" 47 48 #: ../includes/mstw-coaching-staffs-admin.php:234 49 #: ../includes/mstw-coaching-staffs-admin.php:385 50 #: ../includes/mstw-cs-utility-functions.php:49 51 msgid "Experience" 52 msgstr "" 53 54 #: ../includes/mstw-coaching-staffs-admin.php:239 55 #: ../includes/mstw-coaching-staffs-admin.php:384 56 #: ../includes/mstw-cs-utility-functions.php:51 57 msgid "Alma Mater" 58 msgstr "" 59 60 #: ../includes/mstw-coaching-staffs-admin.php:244 61 #: ../includes/mstw-coaching-staffs-admin.php:386 62 #: ../includes/mstw-cs-utility-functions.php:53 63 msgid "Degree" 64 msgstr "" 65 66 #: ../includes/mstw-coaching-staffs-admin.php:249 67 #: ../includes/mstw-coaching-staffs-admin.php:387 68 msgid "Birth Date" 69 msgstr "" 70 71 #: ../includes/mstw-coaching-staffs-admin.php:254 72 #: ../includes/mstw-coaching-staffs-admin.php:388 73 msgid "Home Town" 74 msgstr "" 75 76 #: ../includes/mstw-coaching-staffs-admin.php:259 77 #: ../includes/mstw-coaching-staffs-admin.php:389 78 #: ../includes/mstw-cs-utility-functions.php:59 79 msgid "High School" 80 msgstr "" 81 82 #: ../includes/mstw-coaching-staffs-admin.php:264 83 #: ../includes/mstw-coaching-staffs-admin.php:390 84 #: ../includes/mstw-cs-utility-functions.php:61 85 msgid "Family" 86 msgstr "" 87 88 #: ../includes/mstw-coaching-staffs-admin.php:291 89 msgid "Select coach" 90 msgstr "" 91 92 #: ../includes/mstw-coaching-staffs-admin.php:323 93 msgid "Display Order:" 94 msgstr "" 95 96 #: ../includes/mstw-coaching-staffs-admin.php:382 97 #: ../includes/mstw-cs-utility-functions.php:46 98 msgid "Name" 99 msgstr "" 100 101 #: ../includes/mstw-coaching-staffs-admin.php:383 102 #: ../includes/mstw-cs-utility-functions.php:45 103 msgid "Photo" 104 msgstr "" 105 106 #: ../includes/mstw-coaching-staffs-admin.php:459 107 #: ../includes/mstw-cs-utility-functions.php:47 108 msgid "Position" 109 msgstr "" 110 111 #: ../includes/mstw-coaching-staffs-admin.php:460 112 msgid "Staff" 113 msgstr "" 114 115 #: ../includes/mstw-coaching-staffs-admin.php:507 100 #: ../includes/mstw-coaching-staffs-admin.php:528 116 101 msgid "MSTW Coaching Staffs" 117 102 msgstr "" 118 103 119 #: ../includes/mstw-coaching-staffs-admin.php:5 08120 #: ../includes/mstw-coaching-staffs-admin.php:5 17104 #: ../includes/mstw-coaching-staffs-admin.php:529 105 #: ../includes/mstw-coaching-staffs-admin.php:538 121 106 msgid "Coaching Staffs" 122 107 msgstr "" 123 108 124 #: ../includes/mstw-coaching-staffs-admin.php:5 18109 #: ../includes/mstw-coaching-staffs-admin.php:539 125 110 msgid "Staffs" 126 111 msgstr "" 127 112 128 #: ../includes/mstw-coaching-staffs-admin.php:5 25113 #: ../includes/mstw-coaching-staffs-admin.php:546 129 114 msgid "Coaching Staffs Display Settings" 130 115 msgstr "" 131 116 132 #: ../includes/mstw-coaching-staffs-admin.php:5 26117 #: ../includes/mstw-coaching-staffs-admin.php:547 133 118 msgid "Display Settings" 134 119 msgstr "" 135 120 136 #: ../includes/mstw-coaching-staffs-admin.php:543 137 msgid "Save Changes" 138 msgstr "" 139 140 #: ../includes/mstw-coaching-staffs-admin.php:545 141 msgid "Reset Default Values" 142 msgstr "" 143 144 #: ../includes/mstw-coaching-staffs-admin.php:546 145 msgid "WARNING! Reset Default Values will do so without further warning!" 146 msgstr "" 147 148 #: ../includes/mstw-coaching-staffs-admin.php:593 149 msgid "Data Field Settings" 150 msgstr "" 151 152 #: ../includes/mstw-coaching-staffs-admin.php:607 121 #: ../includes/mstw-coaching-staffs-admin.php:632 153 122 msgid "Name Label:" 154 123 msgstr "" 155 124 156 #: ../includes/mstw-coaching-staffs-admin.php:6 24125 #: ../includes/mstw-coaching-staffs-admin.php:648 157 126 msgid "Show Position:" 158 127 msgstr "" 159 128 160 #: ../includes/mstw-coaching-staffs-admin.php:6 42129 #: ../includes/mstw-coaching-staffs-admin.php:664 161 130 msgid "Position Label:" 162 131 msgstr "" 163 132 164 #: ../includes/mstw-coaching-staffs-admin.php:6 58133 #: ../includes/mstw-coaching-staffs-admin.php:680 165 134 msgid "Show Experience:" 166 135 msgstr "" 167 136 168 #: ../includes/mstw-coaching-staffs-admin.php:6 74137 #: ../includes/mstw-coaching-staffs-admin.php:696 169 138 msgid "Experience Label:" 170 139 msgstr "" 171 140 172 #: ../includes/mstw-coaching-staffs-admin.php: 690141 #: ../includes/mstw-coaching-staffs-admin.php:712 173 142 msgid "Show Alma Mater:" 174 143 msgstr "" 175 144 176 #: ../includes/mstw-coaching-staffs-admin.php:7 06145 #: ../includes/mstw-coaching-staffs-admin.php:728 177 146 msgid "Alma Mater Label:" 178 147 msgstr "" 179 148 180 #: ../includes/mstw-coaching-staffs-admin.php:7 22149 #: ../includes/mstw-coaching-staffs-admin.php:744 181 150 msgid "Show Degree:" 182 151 msgstr "" 183 152 184 #: ../includes/mstw-coaching-staffs-admin.php:7 38153 #: ../includes/mstw-coaching-staffs-admin.php:760 185 154 msgid "Degree Label:" 186 155 msgstr "" 187 156 188 #: ../includes/mstw-coaching-staffs-admin.php:7 54157 #: ../includes/mstw-coaching-staffs-admin.php:776 189 158 msgid "Show Birth Date:" 190 159 msgstr "" 191 160 192 #: ../includes/mstw-coaching-staffs-admin.php:7 70161 #: ../includes/mstw-coaching-staffs-admin.php:792 193 162 msgid "Birth Date Label:" 194 163 msgstr "" 195 164 196 #: ../includes/mstw-coaching-staffs-admin.php: 786165 #: ../includes/mstw-coaching-staffs-admin.php:808 197 166 msgid "Show Hometown:" 198 167 msgstr "" 199 168 200 #: ../includes/mstw-coaching-staffs-admin.php:8 02169 #: ../includes/mstw-coaching-staffs-admin.php:824 201 170 msgid "Hometown Label:" 202 171 msgstr "" 203 172 204 #: ../includes/mstw-coaching-staffs-admin.php:8 18173 #: ../includes/mstw-coaching-staffs-admin.php:840 205 174 msgid "Show High School:" 206 175 msgstr "" 207 176 208 #: ../includes/mstw-coaching-staffs-admin.php:8 34177 #: ../includes/mstw-coaching-staffs-admin.php:856 209 178 msgid "High School Label:" 210 179 msgstr "" 211 180 212 #: ../includes/mstw-coaching-staffs-admin.php:8 50181 #: ../includes/mstw-coaching-staffs-admin.php:872 213 182 msgid "Show Family:" 214 183 msgstr "" 215 184 216 #: ../includes/mstw-coaching-staffs-admin.php:8 66185 #: ../includes/mstw-coaching-staffs-admin.php:888 217 186 msgid "Family Label:" 218 187 msgstr "" 219 188 220 #: ../includes/mstw-coaching-staffs-admin.php: 887189 #: ../includes/mstw-coaching-staffs-admin.php:909 221 190 msgid "Staff Table/[shortcode] Settings" 222 191 msgstr "" 223 192 224 #: ../includes/mstw-coaching-staffs-admin.php:9 03225 #: ../includes/mstw-coaching-staffs-admin.php:13 41193 #: ../includes/mstw-coaching-staffs-admin.php:925 194 #: ../includes/mstw-coaching-staffs-admin.php:1364 226 195 msgid "" 227 196 "Will use \"Staff Name\" from Staff taxonomy as default. Hide to use another " … … 229 198 msgstr "" 230 199 231 #: ../includes/mstw-coaching-staffs-admin.php:9 08200 #: ../includes/mstw-coaching-staffs-admin.php:930 232 201 msgid "Show Staff Table Titles:" 233 202 msgstr "" 234 203 235 #: ../includes/mstw-coaching-staffs-admin.php:927 236 msgid "Table Title Color:" 237 msgstr "" 238 239 #: ../includes/mstw-coaching-staffs-admin.php:939 204 #: ../includes/mstw-coaching-staffs-admin.php:961 240 205 msgid "Will show coaches photos in the staff tables" 241 206 msgstr "" 242 207 243 #: ../includes/mstw-coaching-staffs-admin.php:9 44208 #: ../includes/mstw-coaching-staffs-admin.php:966 244 209 msgid "Show Photos:" 245 210 msgstr "" 246 211 247 #: ../includes/mstw-coaching-staffs-admin.php:9 56212 #: ../includes/mstw-coaching-staffs-admin.php:978 248 213 msgid "Set width in pixels for table photos, if shown. (Default: 80px)" 249 214 msgstr "" 250 215 251 #: ../includes/mstw-coaching-staffs-admin.php:9 61216 #: ../includes/mstw-coaching-staffs-admin.php:983 252 217 msgid "Table Photo Width:" 253 218 msgstr "" 254 219 255 #: ../includes/mstw-coaching-staffs-admin.php:9 72220 #: ../includes/mstw-coaching-staffs-admin.php:994 256 221 msgid "Set height in pixels for table photos, if shown. (Default: 80px)" 257 222 msgstr "" 258 223 259 #: ../includes/mstw-coaching-staffs-admin.php:9 77224 #: ../includes/mstw-coaching-staffs-admin.php:999 260 225 msgid "Table Photo Height:" 261 226 msgstr "" 262 227 263 #: ../includes/mstw-coaching-staffs-admin.php: 993228 #: ../includes/mstw-coaching-staffs-admin.php:1015 264 229 msgid "Table Border Color:" 265 230 msgstr "" 266 231 267 #: ../includes/mstw-coaching-staffs-admin.php:10 04232 #: ../includes/mstw-coaching-staffs-admin.php:1026 268 233 msgid "Set table border width in pixels (default:2px)" 269 234 msgstr "" 270 235 271 #: ../includes/mstw-coaching-staffs-admin.php:10 09236 #: ../includes/mstw-coaching-staffs-admin.php:1031 272 237 msgid "Table Border Width:" 273 238 msgstr "" 274 239 275 #: ../includes/mstw-coaching-staffs-admin.php:10 25240 #: ../includes/mstw-coaching-staffs-admin.php:1047 276 241 msgid "Table Header Background Color:" 277 242 msgstr "" 278 243 279 #: ../includes/mstw-coaching-staffs-admin.php:10 41244 #: ../includes/mstw-coaching-staffs-admin.php:1063 280 245 msgid "Table Header Text Color:" 281 246 msgstr "" 282 247 283 #: ../includes/mstw-coaching-staffs-admin.php:10 57248 #: ../includes/mstw-coaching-staffs-admin.php:1079 284 249 msgid "Table Even Row Text Color:" 285 250 msgstr "" 286 251 287 #: ../includes/mstw-coaching-staffs-admin.php:10 73252 #: ../includes/mstw-coaching-staffs-admin.php:1095 288 253 msgid "Table Even Row Background Color:" 289 254 msgstr "" 290 255 291 #: ../includes/mstw-coaching-staffs-admin.php:1 089256 #: ../includes/mstw-coaching-staffs-admin.php:1111 292 257 msgid "Table Even Row Link Color:" 293 258 msgstr "" 294 259 295 #: ../includes/mstw-coaching-staffs-admin.php:11 05260 #: ../includes/mstw-coaching-staffs-admin.php:1127 296 261 msgid "Table Odd Row Text Color:" 297 262 msgstr "" 298 263 299 #: ../includes/mstw-coaching-staffs-admin.php:11 21264 #: ../includes/mstw-coaching-staffs-admin.php:1143 300 265 msgid "Table Odd Row Background Color:" 301 266 msgstr "" 302 267 303 #: ../includes/mstw-coaching-staffs-admin.php:11 37268 #: ../includes/mstw-coaching-staffs-admin.php:1159 304 269 msgid "Table Odd Row Link Color:" 305 270 msgstr "" 306 271 307 #: ../includes/mstw-coaching-staffs-admin.php:11 56272 #: ../includes/mstw-coaching-staffs-admin.php:1178 308 273 msgid "Coach Profile Settings" 309 274 msgstr "" 310 275 311 #: ../includes/mstw-coaching-staffs-admin.php:11 65276 #: ../includes/mstw-coaching-staffs-admin.php:1187 312 277 msgid "The text for the coach's profile bio heading." 313 278 msgstr "" 314 279 315 #: ../includes/mstw-coaching-staffs-admin.php:11 70280 #: ../includes/mstw-coaching-staffs-admin.php:1192 316 281 msgid "Profile Heading:" 317 282 msgstr "" 318 283 319 #: ../includes/mstw-coaching-staffs-admin.php:1 186284 #: ../includes/mstw-coaching-staffs-admin.php:1208 320 285 msgid "Header Background Color:" 321 286 msgstr "" 322 287 323 #: ../includes/mstw-coaching-staffs-admin.php:12 02288 #: ../includes/mstw-coaching-staffs-admin.php:1224 324 289 msgid "Header Text Color:" 325 290 msgstr "" 326 291 327 #: ../includes/mstw-coaching-staffs-admin.php:12 18292 #: ../includes/mstw-coaching-staffs-admin.php:1240 328 293 msgid "Name Color:" 329 294 msgstr "" 330 295 331 #: ../includes/mstw-coaching-staffs-admin.php:12 34296 #: ../includes/mstw-coaching-staffs-admin.php:1256 332 297 msgid "Position Color:" 333 298 msgstr "" 334 299 335 #: ../includes/mstw-coaching-staffs-admin.php:12 50300 #: ../includes/mstw-coaching-staffs-admin.php:1272 336 301 msgid "Bio Section Heading Color:" 337 302 msgstr "" 338 303 339 #: ../includes/mstw-coaching-staffs-admin.php:12 66304 #: ../includes/mstw-coaching-staffs-admin.php:1288 340 305 msgid "Bio Section Text Color:" 341 306 msgstr "" 342 307 343 #: ../includes/mstw-coaching-staffs-admin.php:1 282308 #: ../includes/mstw-coaching-staffs-admin.php:1304 344 309 msgid "Bio Section Background Color:" 345 310 msgstr "" 346 311 347 #: ../includes/mstw-coaching-staffs-admin.php:1 298312 #: ../includes/mstw-coaching-staffs-admin.php:1320 348 313 msgid "Bio Section Border Color:" 349 314 msgstr "" 350 315 351 #: ../includes/mstw-coaching-staffs-admin.php:13 09316 #: ../includes/mstw-coaching-staffs-admin.php:1331 352 317 msgid "Set bio border width in pixels (default:2px)" 353 318 msgstr "" 354 319 355 #: ../includes/mstw-coaching-staffs-admin.php:13 14320 #: ../includes/mstw-coaching-staffs-admin.php:1336 356 321 msgid "Bio Section Border Width:" 357 322 msgstr "" 358 323 359 #: ../includes/mstw-coaching-staffs-admin.php:13 32324 #: ../includes/mstw-coaching-staffs-admin.php:1354 360 325 msgid "Coaches Gallery Settings" 361 326 msgstr "" 362 327 363 #: ../includes/mstw-coaching-staffs-admin.php:13 46328 #: ../includes/mstw-coaching-staffs-admin.php:1369 364 329 msgid "Show Gallery Title:" 365 330 msgstr "" 366 331 367 #: ../includes/mstw-coaching-staffs-admin.php:13 62332 #: ../includes/mstw-coaching-staffs-admin.php:1385 368 333 msgid "Gallery Title Color:" 369 334 msgstr "" 370 335 371 #: ../includes/mstw-coaching-staffs-admin.php:13 73336 #: ../includes/mstw-coaching-staffs-admin.php:1397 372 337 msgid "Default is rounded." 373 338 msgstr "" 374 339 375 #: ../includes/mstw-coaching-staffs-admin.php:13 74340 #: ../includes/mstw-coaching-staffs-admin.php:1398 376 341 msgid "Rounded" 377 342 msgstr "" 378 343 379 #: ../includes/mstw-coaching-staffs-admin.php:13 75344 #: ../includes/mstw-coaching-staffs-admin.php:1399 380 345 msgid "Square" 381 346 msgstr "" 382 347 383 #: ../includes/mstw-coaching-staffs-admin.php:1 381348 #: ../includes/mstw-coaching-staffs-admin.php:1405 384 349 msgid "Gallery Tile Corner Style:" 385 350 msgstr "" 386 351 387 #: ../includes/mstw-coaching-staffs-admin.php:1 392352 #: ../includes/mstw-coaching-staffs-admin.php:1416 388 353 msgid "Set width in pixels for gallery photos, if shown. (Default: 150px)" 389 354 msgstr "" 390 355 391 #: ../includes/mstw-coaching-staffs-admin.php:1 397356 #: ../includes/mstw-coaching-staffs-admin.php:1421 392 357 msgid "Gallery Photo Width:" 393 358 msgstr "" 394 359 395 #: ../includes/mstw-coaching-staffs-admin.php:14 08360 #: ../includes/mstw-coaching-staffs-admin.php:1432 396 361 msgid "Set height in pixels for gallery photos, if shown. (Default: 150px)" 397 362 msgstr "" 398 363 399 #: ../includes/mstw-coaching-staffs-admin.php:14 13364 #: ../includes/mstw-coaching-staffs-admin.php:1437 400 365 msgid "Gallery Photo Height:" 401 366 msgstr "" 402 367 403 #: ../includes/mstw-coaching-staffs-admin.php:14 29368 #: ../includes/mstw-coaching-staffs-admin.php:1453 404 369 msgid "Gallery Tile Border Color:" 405 370 msgstr "" 406 371 407 #: ../includes/mstw-coaching-staffs-admin.php:14 40372 #: ../includes/mstw-coaching-staffs-admin.php:1464 408 373 msgid "Set border width in pixels. (Default: 2px)" 409 374 msgstr "" 410 375 411 #: ../includes/mstw-coaching-staffs-admin.php:14 45376 #: ../includes/mstw-coaching-staffs-admin.php:1469 412 377 msgid "Gallery Tile Border Width:" 413 378 msgstr "" 414 379 415 #: ../includes/mstw-coaching-staffs-admin.php:1454 416 msgid "Enter the default settings for Coaches Gallery pages." 417 msgstr "" 418 419 #: ../includes/mstw-coaching-staffs-admin.php:1458 420 msgid "Enter the default settings for Single Coach Profile pages." 421 msgstr "" 422 423 #: ../includes/mstw-coaching-staffs-admin.php:1462 424 msgid "" 425 "Enter the default settings for Staff Table/[shortcode]. These can be " 426 "overridden by [shortcode] arguments." 427 msgstr "" 428 429 #: ../includes/mstw-coaching-staffs-admin.php:1466 430 msgid "" 431 "Enter the visibility and labels for the data fiels. The name field must " 432 "always be displayed, but it can be re-labeled. Note that these settings can " 433 "be overridden by [shortcode] arguments." 434 msgstr "" 435 436 #: ../includes/mstw-coaching-staffs-admin.php:1578 437 #: ../includes/mstw-coaching-staffs-admin.php:1581 380 #: ../includes/mstw-coaching-staffs-admin.php:1605 381 #: ../includes/mstw-coaching-staffs-admin.php:1608 438 382 msgid "Coach updated." 439 383 msgstr "" 440 384 441 #: ../includes/mstw-coaching-staffs-admin.php:1 579442 #: ../includes/mstw-coaching-staffs-admin.php:1 593385 #: ../includes/mstw-coaching-staffs-admin.php:1606 386 #: ../includes/mstw-coaching-staffs-admin.php:1620 443 387 msgid "Custom field updated." 444 388 msgstr "" 445 389 446 #: ../includes/mstw-coaching-staffs-admin.php:1 580447 #: ../includes/mstw-coaching-staffs-admin.php:1 594390 #: ../includes/mstw-coaching-staffs-admin.php:1607 391 #: ../includes/mstw-coaching-staffs-admin.php:1621 448 392 msgid "Custom field deleted." 449 393 msgstr "" 450 394 451 #: ../includes/mstw-coaching-staffs-admin.php:1 582395 #: ../includes/mstw-coaching-staffs-admin.php:1609 452 396 msgid "Coach restored to revision" 453 397 msgstr "" 454 398 455 #: ../includes/mstw-coaching-staffs-admin.php:1 583399 #: ../includes/mstw-coaching-staffs-admin.php:1610 456 400 msgid "Coach published." 457 401 msgstr "" 458 402 459 #: ../includes/mstw-coaching-staffs-admin.php:1 584403 #: ../includes/mstw-coaching-staffs-admin.php:1611 460 404 msgid "Coach saved." 461 405 msgstr "" 462 406 463 #: ../includes/mstw-coaching-staffs-admin.php:1 585407 #: ../includes/mstw-coaching-staffs-admin.php:1612 464 408 msgid "Coach submitted." 465 409 msgstr "" 466 410 467 #: ../includes/mstw-coaching-staffs-admin.php:1 586411 #: ../includes/mstw-coaching-staffs-admin.php:1613 468 412 msgid "Coach scheduled for publication." 469 413 msgstr "" 470 414 471 #: ../includes/mstw-coaching-staffs-admin.php:1 587415 #: ../includes/mstw-coaching-staffs-admin.php:1614 472 416 msgid "Coach draft updated." 473 417 msgstr "" 474 418 475 #: ../includes/mstw-coaching-staffs-admin.php:1 592476 #: ../includes/mstw-coaching-staffs-admin.php:1 595419 #: ../includes/mstw-coaching-staffs-admin.php:1619 420 #: ../includes/mstw-coaching-staffs-admin.php:1622 477 421 msgid "Position updated." 478 422 msgstr "" 479 423 480 #: ../includes/mstw-coaching-staffs-admin.php:1 596424 #: ../includes/mstw-coaching-staffs-admin.php:1623 481 425 msgid "Position restored to revision" 482 426 msgstr "" 483 427 484 #: ../includes/mstw-coaching-staffs-admin.php:1 597428 #: ../includes/mstw-coaching-staffs-admin.php:1624 485 429 msgid "Position published." 486 430 msgstr "" 487 431 488 #: ../includes/mstw-coaching-staffs-admin.php:1 598432 #: ../includes/mstw-coaching-staffs-admin.php:1625 489 433 msgid "Position saved." 490 434 msgstr "" 491 435 492 #: ../includes/mstw-coaching-staffs-admin.php:1 599436 #: ../includes/mstw-coaching-staffs-admin.php:1626 493 437 msgid "Position submitted." 494 438 msgstr "" 495 439 496 #: ../includes/mstw-coaching-staffs-admin.php:16 00440 #: ../includes/mstw-coaching-staffs-admin.php:1627 497 441 msgid "Position scheduled for publication." 498 442 msgstr "" 499 443 500 #: ../includes/mstw-coaching-staffs-admin.php:16 01444 #: ../includes/mstw-coaching-staffs-admin.php:1628 501 445 msgid "Position draft updated." 502 446 msgstr "" 503 447 504 #: ../includes/mstw-cs-utility-functions.php: 55448 #: ../includes/mstw-cs-utility-functions.php:74 505 449 msgid "Born" 506 450 msgstr "" 507 451 508 #: ../includes/mstw-cs-utility-functions.php:57 509 msgid "Hometown" 452 #: ../includes/mstw-utility-functions.php:171 453 msgid "Mon" 454 msgstr "" 455 456 #: ../includes/mstw-utility-functions.php:172 457 msgid "Tue" 458 msgstr "" 459 460 #: ../includes/mstw-utility-functions.php:173 461 msgid "Wed" 462 msgstr "" 463 464 #: ../includes/mstw-utility-functions.php:174 465 msgid "Thr" 466 msgstr "" 467 468 #: ../includes/mstw-utility-functions.php:175 469 msgid "Fri" 470 msgstr "" 471 472 #: ../includes/mstw-utility-functions.php:176 473 msgid "Sat" 474 msgstr "" 475 476 #: ../includes/mstw-utility-functions.php:177 477 msgid "Sun" 478 msgstr "" 479 480 #: ../includes/mstw-utility-functions.php:180 481 msgid "Monday" 482 msgstr "" 483 484 #: ../includes/mstw-utility-functions.php:181 485 msgid "Tuesday" 510 486 msgstr "" 511 487 512 488 #: ../includes/mstw-utility-functions.php:182 513 msgid " Mon"489 msgid "Wednesday" 514 490 msgstr "" 515 491 516 492 #: ../includes/mstw-utility-functions.php:183 517 msgid "T ue"493 msgid "Thursday" 518 494 msgstr "" 519 495 520 496 #: ../includes/mstw-utility-functions.php:184 521 msgid " Wed"497 msgid "Friday" 522 498 msgstr "" 523 499 524 500 #: ../includes/mstw-utility-functions.php:185 525 msgid " Thr"501 msgid "Saturday" 526 502 msgstr "" 527 503 528 504 #: ../includes/mstw-utility-functions.php:186 529 msgid " Fri"530 msgstr "" 531 532 #: ../includes/mstw-utility-functions.php:18 7533 msgid " Sat"534 msgstr "" 535 536 #: ../includes/mstw-utility-functions.php:1 88537 msgid " Sun"505 msgid "Sunday" 506 msgstr "" 507 508 #: ../includes/mstw-utility-functions.php:189 509 msgid "January" 510 msgstr "" 511 512 #: ../includes/mstw-utility-functions.php:190 513 msgid "February" 538 514 msgstr "" 539 515 540 516 #: ../includes/mstw-utility-functions.php:191 541 msgid "M onday"517 msgid "March" 542 518 msgstr "" 543 519 544 520 #: ../includes/mstw-utility-functions.php:192 545 msgid " Tuesday"521 msgid "April" 546 522 msgstr "" 547 523 548 524 #: ../includes/mstw-utility-functions.php:193 549 msgid "Wednesday" 525 #: ../includes/mstw-utility-functions.php:207 526 msgid "May" 550 527 msgstr "" 551 528 552 529 #: ../includes/mstw-utility-functions.php:194 553 msgid " Thursday"530 msgid "June" 554 531 msgstr "" 555 532 556 533 #: ../includes/mstw-utility-functions.php:195 557 msgid " Friday"534 msgid "July" 558 535 msgstr "" 559 536 560 537 #: ../includes/mstw-utility-functions.php:196 561 msgid " Saturday"538 msgid "August" 562 539 msgstr "" 563 540 564 541 #: ../includes/mstw-utility-functions.php:197 565 msgid "Sunday" 542 msgid "September" 543 msgstr "" 544 545 #: ../includes/mstw-utility-functions.php:198 546 msgid "October" 547 msgstr "" 548 549 #: ../includes/mstw-utility-functions.php:199 550 msgid "November" 566 551 msgstr "" 567 552 568 553 #: ../includes/mstw-utility-functions.php:200 569 msgid "January" 570 msgstr "" 571 572 #: ../includes/mstw-utility-functions.php:201 573 msgid "February" 574 msgstr "" 575 576 #: ../includes/mstw-utility-functions.php:202 577 msgid "March" 554 msgid "December" 578 555 msgstr "" 579 556 580 557 #: ../includes/mstw-utility-functions.php:203 581 msgid " April"558 msgid "Jan" 582 559 msgstr "" 583 560 584 561 #: ../includes/mstw-utility-functions.php:204 585 #: ../includes/mstw-utility-functions.php:218 586 msgid "May" 562 msgid "Feb" 587 563 msgstr "" 588 564 589 565 #: ../includes/mstw-utility-functions.php:205 590 msgid " June"566 msgid "Mar" 591 567 msgstr "" 592 568 593 569 #: ../includes/mstw-utility-functions.php:206 594 msgid "July" 595 msgstr "" 596 597 #: ../includes/mstw-utility-functions.php:207 598 msgid "August" 570 msgid "Apr" 599 571 msgstr "" 600 572 601 573 #: ../includes/mstw-utility-functions.php:208 602 msgid " September"574 msgid "Jun" 603 575 msgstr "" 604 576 605 577 #: ../includes/mstw-utility-functions.php:209 606 msgid " October"578 msgid "Jul" 607 579 msgstr "" 608 580 609 581 #: ../includes/mstw-utility-functions.php:210 610 msgid " November"582 msgid "Aug" 611 583 msgstr "" 612 584 613 585 #: ../includes/mstw-utility-functions.php:211 614 msgid "December" 586 msgid "Sep" 587 msgstr "" 588 589 #: ../includes/mstw-utility-functions.php:212 590 msgid "Oct" 591 msgstr "" 592 593 #: ../includes/mstw-utility-functions.php:213 594 msgid "Nov" 615 595 msgstr "" 616 596 617 597 #: ../includes/mstw-utility-functions.php:214 618 msgid "Jan"619 msgstr ""620 621 #: ../includes/mstw-utility-functions.php:215622 msgid "Feb"623 msgstr ""624 625 #: ../includes/mstw-utility-functions.php:216626 msgid "Mar"627 msgstr ""628 629 #: ../includes/mstw-utility-functions.php:217630 msgid "Apr"631 msgstr ""632 633 #: ../includes/mstw-utility-functions.php:219634 msgid "Jun"635 msgstr ""636 637 #: ../includes/mstw-utility-functions.php:220638 msgid "Jul"639 msgstr ""640 641 #: ../includes/mstw-utility-functions.php:221642 msgid "Aug"643 msgstr ""644 645 #: ../includes/mstw-utility-functions.php:222646 msgid "Sep"647 msgstr ""648 649 #: ../includes/mstw-utility-functions.php:223650 msgid "Oct"651 msgstr ""652 653 #: ../includes/mstw-utility-functions.php:224654 msgid "Nov"655 msgstr ""656 657 #: ../includes/mstw-utility-functions.php:225658 598 msgid "Dec" 659 599 msgstr "" 660 600 661 #: ../includes/mstw-utility-functions.php:348 662 msgid "Default Field" 663 msgstr "" 664 665 #: ../includes/mstw-utility-functions.php:349 666 msgid "Default Label" 667 msgstr "" 668 669 #: ../includes/mstw-utility-functions.php:577 670 #: ../includes/mstw-utility-functions.php:592 671 #: ../includes/mstw-utility-functions.php:602 672 #: ../includes/mstw-utility-functions.php:622 673 #: ../includes/mstw-utility-functions.php:630 674 #: ../includes/mstw-utility-functions.php:641 675 msgid "Custom" 676 msgstr "" 677 678 #: ../includes/mstw-utility-functions.php:578 679 msgid "Tuesday, 07 April 01:15 pm" 680 msgstr "" 681 682 #: ../includes/mstw-utility-functions.php:579 683 msgid "Tuesday, 7 April 01:15 pm" 684 msgstr "" 685 686 #: ../includes/mstw-utility-functions.php:580 687 msgid "Tuesday, 07 April 1:15 pm" 688 msgstr "" 689 690 #: ../includes/mstw-utility-functions.php:581 691 msgid "Tuesday, 7 April 1:15 pm" 692 msgstr "" 693 694 #: ../includes/mstw-utility-functions.php:582 695 #: ../includes/mstw-utility-functions.php:583 696 msgid "Tuesday, 7 April 13:15" 697 msgstr "" 698 699 #: ../includes/mstw-utility-functions.php:584 700 msgid "07 April 13:15" 701 msgstr "" 702 703 #: ../includes/mstw-utility-functions.php:585 704 msgid "7 April 13:15" 705 msgstr "" 706 707 #: ../includes/mstw-utility-functions.php:586 708 msgid "07 April 01:15 pm" 709 msgstr "" 710 711 #: ../includes/mstw-utility-functions.php:587 712 msgid "7 April 01:15 pm" 713 msgstr "" 714 715 #: ../includes/mstw-utility-functions.php:596 716 msgid "Formats for 7 April 2013 13:15." 717 msgstr "" 718 719 #: ../includes/mstw-utility-functions.php:607 720 msgid "07 Apr 2013" 721 msgstr "" 722 723 #: ../includes/mstw-utility-functions.php:608 724 msgid "7 Apr 2013" 725 msgstr "" 726 727 #: ../includes/mstw-utility-functions.php:609 728 msgid "Tues, 07 Apr 2013" 729 msgstr "" 730 731 #: ../includes/mstw-utility-functions.php:610 732 msgid "Tues, 7 Apr 13" 733 msgstr "" 734 735 #: ../includes/mstw-utility-functions.php:611 736 msgid "Tuesday, 7 Apr" 737 msgstr "" 738 739 #: ../includes/mstw-utility-functions.php:612 740 msgid "Tuesday, 07 April 2013" 741 msgstr "" 742 743 #: ../includes/mstw-utility-functions.php:613 744 msgid "Tuesday, 7 April 2013" 745 msgstr "" 746 747 #: ../includes/mstw-utility-functions.php:614 748 msgid "Tues, 07 Apr" 749 msgstr "" 750 751 #: ../includes/mstw-utility-functions.php:615 752 msgid "Tues, 7 Apr" 753 msgstr "" 754 755 #: ../includes/mstw-utility-functions.php:616 756 msgid "07 Apr" 757 msgstr "" 758 759 #: ../includes/mstw-utility-functions.php:617 760 msgid "7 Apr" 761 msgstr "" 762 763 #: ../includes/mstw-utility-functions.php:625 764 msgid "Formats for 7 Apr 2013. Default: 2013-04-07" 765 msgstr "" 766 767 #: ../includes/mstw-utility-functions.php:631 768 msgid "08:00 (24hr)" 769 msgstr "" 770 771 #: ../includes/mstw-utility-functions.php:632 772 msgid "8:00 (24hr)" 773 msgstr "" 774 775 #: ../includes/mstw-utility-functions.php:633 776 msgid "08:00 am" 777 msgstr "" 778 779 #: ../includes/mstw-utility-functions.php:634 780 msgid "08:00 AM" 781 msgstr "" 782 783 #: ../includes/mstw-utility-functions.php:635 784 msgid "8:00 am" 785 msgstr "" 786 787 #: ../includes/mstw-utility-functions.php:636 788 msgid "8:00 AM" 789 msgstr "" 790 791 #: ../includes/mstw-utility-functions.php:644 792 msgid "Formats for eight in the morning. Default: 08:00" 793 msgstr "" 794 795 #: ../theme-templates/single-coach.php:38 796 msgid "Post navigation" 797 msgstr "" 798 799 #: ../theme-templates/single-coach.php:44 800 msgid "Return" 801 msgstr "" 802 803 #: ../theme-templates/single-coach.php:70 601 #: ../theme-templates/single-coach.php:75 804 602 msgid "No Staff Position" 805 603 msgstr "" 806 604 807 #: ../theme-templates/single-coach.php:1 28808 #: ../theme-templates/taxonomy-staffs.php: 112605 #: ../theme-templates/single-coach.php:133 606 #: ../theme-templates/taxonomy-staffs.php:98 809 607 msgid "Default image for" 810 608 msgstr "" 811 609 812 #: ../theme-templates/single-coach.php:13 2813 #: ../theme-templates/taxonomy-staffs.php:1 16610 #: ../theme-templates/single-coach.php:137 611 #: ../theme-templates/taxonomy-staffs.php:102 814 612 msgid "Photo not found." 815 613 msgstr "" 816 614 817 #: ../theme-templates/single-coach.php:2 04615 #: ../theme-templates/single-coach.php:239 818 616 msgid "Profile" 819 617 msgstr "" 820 618 821 #: ../theme-templates/taxonomy-staffs.php: 104619 #: ../theme-templates/taxonomy-staffs.php:90 822 620 msgid "Photo of" 823 621 msgstr "" 622 623 #: ../theme-templates/taxonomy-staffs.php:199 624 msgid "Age" 625 msgstr "" -
coaching-staffs/trunk/mstw-coaching-staffs.php
r3261151 r3290731 41 41 42 42 echo "h1.staff-head-title { \n"; 43 echo mstw_cs_build_css_rule( $options, 'table_title_color', 'color', '');43 echo esc_html( mstw_cs_build_css_rule( $options, 'table_title_color', 'color', '' ) ); 44 44 echo "} \n"; 45 45 46 46 echo "th.mstw-cs-table-head { \n"; 47 echo mstw_cs_build_css_rule( $options, 'table_header_text_color', 'color');48 echo mstw_cs_build_css_rule( $options, 'table_header_bkgd_color', 'background-color');49 echo mstw_cs_build_css_rule( $options, 'table_border_color', 'border-color');50 echo mstw_cs_build_css_rule( $options, 'table_border_width', 'border-width', 'px');47 echo esc_html(mstw_cs_build_css_rule( $options, 'table_header_text_color', 'color' ) ); 48 echo esc_html( mstw_cs_build_css_rule( $options, 'table_header_bkgd_color', 'background-color' ) ); 49 echo esc_html( mstw_cs_build_css_rule( $options, 'table_border_color', 'border-color' ) ); 50 echo esc_html( mstw_cs_build_css_rule( $options, 'table_border_width', 'border-width', 'px' ) ); 51 51 echo "} \n"; 52 52 53 53 echo "td.mstw-cs-odd { \n"; 54 echo mstw_cs_build_css_rule( $options, 'table_odd_text_color', 'color');55 echo mstw_cs_build_css_rule( $options, 'table_odd_bkgd_color', 'background-color');56 echo mstw_cs_build_css_rule( $options, 'table_border_color', 'border-color');57 echo mstw_cs_build_css_rule( $options, 'table_border_width', 'border-width', 'px');54 echo esc_html( mstw_cs_build_css_rule( $options, 'table_odd_text_color', 'color' ) ); 55 echo esc_html( mstw_cs_build_css_rule( $options, 'table_odd_bkgd_color', 'background-color' ) ); 56 echo esc_html( mstw_cs_build_css_rule( $options, 'table_border_color', 'border-color' ) ); 57 echo esc_html( mstw_cs_build_css_rule( $options, 'table_border_width', 'border-width', 'px' ) ); 58 58 echo "} \n"; 59 59 60 60 echo "tr.mstw-cs-odd td.mstw-cs-odd a { \n"; 61 echo mstw_cs_build_css_rule( $options, 'table_odd_link_color', 'color');61 echo esc_html( mstw_cs_build_css_rule( $options, 'table_odd_link_color', 'color' ) ); 62 62 echo "} \n"; 63 63 64 64 echo "td.mstw-cs-even { \n"; 65 echo mstw_cs_build_css_rule( $options, 'table_even_text_color', 'color');66 echo mstw_cs_build_css_rule( $options, 'table_even_bkgd_color', 'background-color');67 echo mstw_cs_build_css_rule( $options, 'table_border_color', 'border-color');68 echo mstw_cs_build_css_rule( $options, 'table_border_width', 'border-width', 'px');65 echo esc_html( mstw_cs_build_css_rule( $options, 'table_even_text_color', 'color' ) ); 66 echo esc_html( mstw_cs_build_css_rule( $options, 'table_even_bkgd_color', 'background-color' ) ); 67 echo esc_html( mstw_cs_build_css_rule( $options, 'table_border_color', 'border-color' ) ); 68 echo esc_html( mstw_cs_build_css_rule( $options, 'table_border_width', 'border-width', 'px' ) ); 69 69 echo "} \n"; 70 70 71 71 echo "tr.mstw-cs-even td.mstw-cs-even a { \n"; 72 echo mstw_cs_build_css_rule( $options, 'table_even_link_color', 'color');72 echo esc_html( mstw_cs_build_css_rule( $options, 'table_even_link_color', 'color' ) ); 73 73 echo "} \n"; 74 74 … … 76 76 //Rules for Single Coach 77 77 echo "div.coach-header { \n"; 78 echo mstw_cs_build_css_rule( $options, 'profile_header_bkgd_color', 'background-color');78 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_bkgd_color', 'background-color' ) ); 79 79 echo "} \n"; 80 80 81 81 echo "#coach-name h1 { \n"; 82 echo mstw_cs_build_css_rule( $options, 'profile_header_name_color', 'color');82 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_name_color', 'color' ) ); 83 83 echo "} \n"; 84 84 85 85 echo "#coach-name h2 { \n"; 86 echo mstw_cs_build_css_rule( $options, 'profile_header_position_color', 'color');86 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_position_color', 'color' ) ); 87 87 echo "} \n"; 88 88 89 89 echo "div.coach-header table { \n"; 90 echo mstw_cs_build_css_rule( $options, 'profile_header_text_color', 'color');90 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_text_color', 'color' ) ); 91 91 echo "} \n"; 92 92 93 93 //bio_heading_color 94 94 echo ".coach-bio h1 { \n"; 95 echo mstw_cs_build_css_rule( $options, 'profile_bio_heading_color', 'color');95 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_bio_heading_color', 'color' ) ); 96 96 echo "} \n"; 97 97 //bio_text_color 98 98 echo ".coach-bio p { \n"; 99 echo mstw_cs_build_css_rule( $options, 'profile_bio_text_color', 'color');99 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_bio_text_color', 'color' ) ); 100 100 echo "} \n"; 101 101 //bio_bkgd_color 102 102 echo ".coach-bio { \n"; 103 echo mstw_cs_build_css_rule( $options, 'profile_bio_bkgd_color', 'background-color' ); 104 //echo "} \n"; 105 //bio_border_color 106 //echo ".coach-bio { \n"; 107 echo mstw_cs_build_css_rule( $options, 'profile_bio_border_color', 'border-color' ); 108 //echo "} \n"; 109 //bio_border_width 110 //echo ".coach-bio { \n"; 111 echo mstw_cs_build_css_rule( $options, 'profile_bio_border_width', 'border-width', 'px' ); 103 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_bio_bkgd_color', 'background-color' ) ); 104 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_bio_border_color', 'border-color' ) ); 105 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_bio_border_width', 'border-width', 'px' ) ); 112 106 echo "} \n"; 113 107 114 108 // Rules for Coaches Galleries 115 109 echo ".coach-tile { \n"; 116 echo mstw_cs_build_css_rule( $options, 'profile_header_bkgd_color', 'background-color' ); 117 echo mstw_cs_build_css_rule( $options, 'profile_header_text_color', 'color' ); 118 //echo mstw_cs_build_css_rule( $options, 'gallery_tile_radius', 'border-radius', 'px' ); 119 //echo mstw_cs_build_css_rule( $options, 'gallery_tile_radius', '-moz-border-radius', 'px' ); 120 echo 'border-radius: ' . $options['gallery_tile_radius'] . "px; \n"; 121 echo '-moz-border-radius: ' . $options['gallery_tile_radius'] . "px; \n"; 122 echo mstw_cs_build_css_rule( $options, 'gallery_tile_border_color', 'border-color' ); 123 echo mstw_cs_build_css_rule( $options, 'gallery_tile_border_width', 'border-width', 'px' ); 110 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_bkgd_color', 'background-color' ) ); 111 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_text_color', 'color' ) ); 112 113 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_tile_radius', 'border-radius', 'px' ) ); 114 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_tile_radius', '-moz-border-radius', 'px' ) ); 115 //echo esc_html( 'border-radius: ' . $options['gallery_tile_radius'] . "px; \n" ); 116 //echo esc_html( '-moz-border-radius: ' . $options['gallery_tile_radius'] . "px; \n" ); 117 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_tile_border_color', 'border-color' ) ); 118 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_tile_border_width', 'border-width', 'px' ) ); 124 119 //echo 'border-width: ' . $options['gallery_tile_border_width'] . "px; \n"; 125 echo mstw_cs_build_css_rule( $options, 'gallery_tile_border_width', 'border-width', 'px');126 echo "} \n"; 127 128 echo "h1.staff-head-title { \n";129 echo mstw_cs_build_css_rule( $options, 'gallery_title_color', 'color');120 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_tile_border_width', 'border-width', 'px' ) ); 121 echo "} \n"; 122 123 echo esc_html( "h1.staff-head-title { \n" ); 124 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_title_color', 'color' ) ); 130 125 echo "} \n"; 131 126 132 127 echo ".coach-photo img, #coach-photo img { \n"; 133 echo mstw_cs_build_css_rule( $options, 'gallery_photo_width', 'width', 'px');134 echo mstw_cs_build_css_rule( $options, 'gallery_photo_height', 'height', 'px');128 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_photo_width', 'width', 'px' ) ); 129 echo esc_html( mstw_cs_build_css_rule( $options, 'gallery_photo_height', 'height', 'px' ) ); 135 130 echo "} \n"; 136 131 137 132 echo ".coach-name-position a { \n"; 138 echo mstw_cs_build_css_rule( $options, 'profile_header_name_color', 'color');133 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_name_color', 'color' ) ); 139 134 echo "} \n"; 140 135 141 136 echo ".coach-name-position h2 { \n"; 142 echo mstw_cs_build_css_rule( $options, 'profile_header_position_color', 'color');143 echo "} \n"; 144 137 echo esc_html( mstw_cs_build_css_rule( $options, 'profile_header_position_color', 'color' ) ); 138 echo "} \n"; 139 145 140 echo '</style>'; 146 141 … … 181 176 // Need to check the need for this first conditional ... someday 182 177 183 if ( !is_admin() && $query->is_tax( 'staffs' ) && $query->is_main_query() ) {178 if ( !is_admin() && is_tax( 'staffs' ) && $query->is_main_query() ) { 184 179 // We are on the coach gallery page ... 185 180 // So set the sort order based on the admin settings … … 187 182 188 183 // Need the team slug to set query 189 $uri_array = explode( '/', $_SERVER['REQUEST_URI'] ); 184 $uri_array = mstw_safe_get( 'REQUEST_URI', $_SERVER, '' ); 185 if ( '' == $uri_array ) { 186 mstw_log_msg( 'mstw_cs_get_posts: error with $_SERVER[REQUEST_URI]' ); 187 mstw_log_msg ( 'query received:' ); mstw_log_msg( $query ); 188 return; 189 } 190 191 $uri_array = explode( '/', $uri_array ); 190 192 $staff_slug = $uri_array[sizeof( $uri_array )-2]; 191 193 … … 252 254 $plugin_data = get_plugin_data( __FILE__, false ); 253 255 254 if ( version_compare($wp_version, " 3.5", "<" ) ) {256 if ( version_compare($wp_version, "4.1", "<" ) ) { 255 257 if( is_plugin_active($plugin) ) { 256 258 deactivate_plugins( $plugin ); 257 wp_die( "'" . $plugin_data['Name']. "' requires WordPress 3.5 or higher, and has been deactivated!258 Please upgrade WordPress and try again.<br /><br />Back to <a href='". admin_url() . "'>WordPress admin</a>." );259 wp_die( "'" . esc_html( $plugin_data['Name'] ) . "' requires WordPress 3.5 or higher, and has been deactivated! 260 Please upgrade WordPress and try again.<br /><br />Back to <a href='". esc_url( admin_url() ) . "'>WordPress admin</a>." ); 259 261 } 260 262 } … … 278 280 // If stylesheet exists, enqueue the style 279 281 if ( file_exists( $mstw_cs_style_file ) ) { 280 wp_register_style( 'mstw-cs-styles', plugins_url( '/css/mstw-cs-styles.css', __FILE__ ) ); 281 //mstw_log_msg( "enqueing " . plugins_url( '/css/mstw-cs-styles.css', __FILE__ ) ); 282 wp_register_style( 'mstw-cs-styles', plugins_url( '/css/mstw-cs-styles.css', __FILE__ ), array(), '1.4', 'all' ); 282 283 wp_enqueue_style( 'mstw-cs-styles' ); 283 284 } 284 285 285 286 $mstw_cs_custom_stylesheet = get_stylesheet_directory( ) . '/mstw-cs-custom-styles.css'; 286 //mstw_log_msg( 'custom stylesheet path: ' . $mstw_cs_custom_stylesheet );287 287 288 288 if ( file_exists( $mstw_cs_custom_stylesheet ) ) { 289 289 $mstw_cs_custom_stylesheet_url = get_stylesheet_directory_uri( ) . '/mstw-cs-custom-styles.css'; 290 //error_log( 'custom stylesheet uri: ' . $mstw_cs_custom_stylesheet_url ); 291 wp_register_style( 'mstw_cs_custom_style', $mstw_cs_custom_stylesheet_url ); 290 wp_register_style( 'mstw_cs_custom_style', $mstw_cs_custom_stylesheet_url, array(), '1.4', 'all' ); 292 291 wp_enqueue_style( 'mstw_cs_custom_style' ); 293 292 } … … 365 364 //'exclude_from_search' => false, 366 365 //'show_ui' => true, 367 'show_in_menu' => 'mstw-cs-main-menu', //=> true, 366 'show_in_menu' => 'mstw-cs-main-menu', //=> true, 368 367 //'menu_position' => null, 369 368 //'menu_icon' => null, … … 432 431 //mstw_log_msg( "mstw_cs_single_coach_template: $single_template" ); 433 432 global $post; 434 435 if ($post->post_type == 'coach') { 436 //$single_template = dirname( __FILE__ ) . '/templates/single-coach.php'; 433 434 $single_template = null; 435 436 if ( $post->post_type == 'coach') { 437 437 $custom_coach_template = get_stylesheet_directory( ) . '/single-coach.php'; 438 438 $plugin_coach_template = dirname( __FILE__ ) . '/theme-templates/single-coach.php'; 439 //mstw_log_msg( "plugin template: $plugin_coach_template" );440 439 441 440 if ( file_exists( $custom_coach_template ) ) { 442 441 $single_template = $custom_coach_template; 443 //mstw_log_msg( "mstw_cs_single_coach_template: using custom template: $custom_coach_template" );444 442 } 445 443 else if ( file_exists( $plugin_coach_template ) ) { 446 444 $single_template = $plugin_coach_template; 447 //mstw_log_msg( "mstw_cs_single_coach_template: using plugin template: $plugin_coach_template" ); 448 } 449 } 450 451 //mstw_log_msg( "mstw_cs_single_coach_template: NEW TEMPLATE: $single_template" ); 445 } 446 } 452 447 453 448 return $single_template; … … 464 459 //mstw_log_msg( "taxonomy: " . get_query_var( 'taxonomy' ) ); 465 460 461 // Return value 462 $template = null; 463 466 464 if ( 'staffs' == get_query_var( 'taxonomy' ) ) { 467 465 $custom_taxonomy_template = get_stylesheet_directory( ) . '/taxonomy-staffs.php'; … … 470 468 if ( file_exists( $custom_taxonomy_template ) ) { 471 469 $template = $custom_taxonomy_template; 472 //mstw_log_msg( "using custom template: $custom_taxonomy_template" );473 470 } 474 471 else if ( file_exists( $plugin_taxonomy_template ) ) { 475 472 $template = $plugin_taxonomy_template; 476 //mstw_log_msg( "using plugin template: $plugin_taxonomy_template" );477 }478 else {479 //mstw_log_msg( "could not find a taxonomy template?? $custom_taxonomy_template or $plugin_taxonomy_template " );480 473 } //End: if ( file_exists( $custom_taxonomy_template ) ) { 481 474 482 475 } //End: if ( file_exists( $custom_taxonomy_template ) ) { 483 476 484 //mstw_log_msg( "returning template: $template" );485 477 return $template; 486 478 … … 620 612 } 621 613 622 $output = $output . '</tr></thead>'; 614 $output = $output . '</tr></thead>'; 615 616 // Check to see if a single_coach.php template exists in 617 // the active theme directory, or in the plugin directory 618 // if so add the links to the table 619 $custom_taxonomy_template = get_stylesheet_directory( ) . '/taxonomy-staffs.php'; 620 $plugin_taxonomy_template = dirname( __FILE__ ) . '/theme-templates/taxonomy-staffs.php'; 621 622 if ( file_exists( $custom_taxonomy_template ) or file_exists( $plugin_taxonomy_template ) ) { 623 $single_coach_template = true; 624 } else { 625 $single_coach_template = false; 626 } 623 627 624 628 // Keeps track of even and odd rows. Start with row 1 = odd. … … 642 646 $coach_id = get_post_meta( $post->ID, 'mstw_cs_position_coach', true ); 643 647 644 // Check to see if a single_coach.php template exists in 645 // the active theme directory, or in the plugin directory 646 // if so add the links to the table 647 $custom_taxonomy_template = get_stylesheet_directory( ) . '/taxonomy-staffs.php'; 648 $plugin_taxonomy_template = dirname( __FILE__ ) . '/theme-templates/taxonomy-staffs.php'; 649 650 if ( file_exists( $custom_taxonomy_template ) or file_exists( $plugin_taxonomy_template ) ) { 651 $single_coach_template = true; 652 } else { 653 $single_coach_template = false; 654 } 648 655 649 656 650 if ( $show_photos ) { … … 659 653 if ( has_post_thumbnail( $coach_id ) ) { 660 654 if ( $single_coach_template ) { 661 $row_string .= '<a href="' . get_permalink( $coach_id ) . '?position='. $post->ID . '">'; 655 656 $coachURL = mstw_cs_build_coach_url( $post->ID, $coach_id ); 657 658 659 $nonceURL = wp_nonce_url( get_permalink( $coach_id ), 'single-coach', 'mstw-cs-nonce' ); 660 $nonceURL .= '&position='. $post->ID; 661 662 $coachLink = mstw_cs_build_coach_link_html( $coachURL, get_the_post_thumbnail( $coach_id, array( $table_photo_width, $table_photo_height ) ) ); 663 664 //mstw_log_msg( "coachLink= $coachLink" ); 665 //$row_string .= '<a href="' . get_permalink( $coach_id ) . '&position='. $post->ID . '>"'; 666 662 667 $row_string .= get_the_post_thumbnail( $coach_id, array($table_photo_width, $table_photo_height) ) . '</a></td>'; 663 668 } … … 682 687 683 688 if ( $single_coach_template ) { 684 //$coach_html = '<a href="' . get_permalink( $coach_id ) . '" '; 685 $coach_html = '<a href="' . get_permalink( $coach_id ) . '?position='. $post->ID . '">'; 686 $coach_html .= $coach_name . '</a>'; 689 $coachURL = mstw_cs_build_coach_url( $post->ID, $coach_id ); 690 $coach_html = mstw_cs_build_coach_link_html( $coachURL, $coach_name ); 687 691 } 688 692 else { -
coaching-staffs/trunk/readme.txt
r3215779 r3290731 3 3 Donate link: http://shoalsummitsolutions.com 4 4 Tags: sports,teams,coaches,staffs 5 Requires at least: 3.66 Tested up to: 6. 7.15 Requires at least: 5.2 6 Tested up to: 6.8 7 7 Stable tag: 1.5 8 Requires PHP: 7. 08 Requires PHP: 7.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
coaching-staffs/trunk/theme-templates/single-coach.php
r3215779 r3290731 8 8 * 9 9 * MSTW Wordpress Plugins (http://shoalsummitsolutions.com) 10 * Copyright 2015-2 4Mark O'Donnell ([email protected])10 * Copyright 2015-25 Mark O'Donnell ([email protected]) 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify … … 24 24 *-------------------------------------------------------------------------*/ 25 25 ?> 26 26 <?php //Validate the nonce 27 //$nonce = mstw_safe_get( 'mstw-cs-nonce', $_GET, '' ); 28 if ( isset( $_GET['mstw-cs-nonce'] ) ) { 29 //$safeNonce = mstw_safe_get( 'mstw-cs-nonce', $_GET, '' ); 30 if ( false == wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ 'mstw-cs-nonce' ] ) ), 'single-coach' ) ) { 31 mstw_log_msg( "single-coach: invalid nonce" ); 32 die( __('fatal error encountered in single_coach', 'coaching-staffs' ) ); 33 } 34 } else { 35 mstw_log_msg( "single-coach: nonce not found" ); 36 die( __('fatal error encountered in single_coach', 'coaching-staffs' ) ); 37 } 38 39 40 ?> 41 27 42 <?php get_header(); 28 43 //mstw_log_msg( "starting single-coach: current post ID = " . $post->ID ); ?> … … 31 46 <div id="content" role="main"> 32 47 33 <?php while ( have_posts() ) : the_post( ); ?> 34 35 <?php if ( array_key_exists( 'HTTP_REFERER', $_SERVER ) ) { ?> 36 37 <nav id="nav-single"> 38 <h3 class="assistive-text"><?php _e( 'Post navigation', 'coaching-staffs' ); ?></h3> 39 40 <span class="nav-previous"> 41 <?php $back =$_SERVER['HTTP_REFERER']; 42 if( isset( $back ) && $back != '' ) { 43 echo '<a href="' . $back . '">';?> 44 <span class="meta-nav">←</span><?php _e( 'Return', 'coaching-staffs' ); ?></a> 45 <?php 46 }?> 47 </span> <!-- .nav-previous --> 48 </nav><!-- #nav-single --> 49 50 <?php } //End: if( array_key_exists( 'HTTP_REFERER', $_SERVER ) ?> 51 52 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 48 <?php while ( have_posts() ) : the_post( ); ?> 49 50 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 53 51 54 52 <?php … … 57 55 58 56 // Check to see if there is a postion in the URL 59 $position_post = mstw_safe_get( 'position', $_GET, '' ); 57 $position_post = mstw_safe_get( 'position', $_GET, '' ); 60 58 61 59 if ( $position_post ) { 62 60 $position = get_the_title( $position_post ); 63 $term_list = wp_get_post_terms( $_GET['position'], 'staffs' ); 61 //$position = mstw_safe_get( 'position', $_GET, '' ); 62 63 if ('' != $position ) { 64 $term_list = wp_get_post_terms( $position, 'staffs' ); 65 } 66 else { 67 $term_list = null; 68 } 64 69 65 70 } else { … … 101 106 ?> 102 107 103 <div class="coach-header <?php echo ( $header_class ) ?>">108 <div class="coach-header <?php echo esc_url( $header_class ) ?>"> 104 109 <!-- First, figure out the coach's photo --> 105 110 <div id = "coach-photo"> … … 115 120 116 121 // check if the post has a Post Thumbnail assigned to it. 117 if ( has_post_thumbnail( ) ) { //defaults to current post122 if ( has_post_thumbnail( ) ) { //defaults to current post 118 123 //Get the photo file; 119 124 $photo_file_url = wp_get_attachment_thumb_url( get_post_thumbnail_id( ) ); //defaults to current post … … 133 138 } 134 139 } 135 136 echo( '<img src="' . $photo_file_url . '" alt="' . $alt . '" width="' . $img_width . '" height="' . $img_height . '" />' );137 140 ?> 141 <img src="<?php echo esc_url( $photo_file_url ) ?>" alt="<?php echo esc_html( $alt ) ?>" width="<?php echo esc_html( $img_width ) ?>" height="<?php echo esc_html( $img_height ) ?>" /> 142 138 143 </div> <!-- #coach-photo --> 139 144 140 <!-- Figure out the coach name and number-->145 <!-- Figure out the coach name and position, which are always displayed --> 141 146 <div id="coach-name-position"> 142 147 <div id="coach-name"> 143 <h1><?php echo $name;?></h1>148 <h1><?php echo esc_html( $name ) ?></h1> 144 149 <!-- get the position ID from the URL --> 145 <h2><?php echo $position;?> </h2>150 <h2><?php echo esc_html( $position ) ?> </h2> 146 151 </div> <!-- #coach-name --> 147 148 152 149 153 <table class="coach-info"> 150 154 <tbody> 151 155 <?php 152 $row_start = '<tr><td class="lf-col">';153 $new_cell = ':</td><td class="rt-col">'; //colon is for the end of the title154 $row_end = '</td></tr>';155 156 156 //EXPERIENCE 157 if( $options['show_experience'] ) { 158 echo $row_start . $options['experience_label'] . $new_cell . $experience . $row_end; 157 if( 0 != mstw_safe_get( 'show_experience', $options, 1 ) ) { 158 ?> 159 <tr> 160 <td class="lf-col"><?php echo esc_html( $options['experience_label'] ) ?></td> 161 <td class="rt-col"><?php echo esc_html( $experience ) ?></td> 162 </tr> 163 <?php 159 164 } 160 165 161 166 //ALMA MATER 162 if( $options['show_alma_mater'] ) { 163 echo $row_start . $options['alma_mater_label'] . $new_cell . $alma_mater . $row_end; 167 //if( $options['show_alma_mater'] ) { 168 if( 0 != mstw_safe_get( 'show_alma_mater', $options, 1 ) ) { 169 ?> 170 <tr> 171 <td class="lf-col"><?php echo esc_html( $options['alma_mater_label'] ) ?></td> 172 <td class="rt-col"><?php echo esc_html( $alma_mater ) ?></td> 173 </tr> 174 <?php 164 175 } 165 176 166 177 // DEGREE 167 if( $options['show_degree'] ) { 168 echo $row_start . $options['degree_label'] . $new_cell . $degree . $row_end; 178 if( 0 != mstw_safe_get( 'show_degree', $options, 0 ) ) { 179 ?> 180 <tr> 181 <td class="lf-col"><?php echo esc_html( $options['degree_label'] ) ?></td> 182 <td class="rt-col"><?php echo esc_html( $degree ) ?></td> 183 </tr> 184 <?php 169 185 } 170 186 171 187 // BIRTH DATE 172 if( $options['show_birth_date'] ) { 173 echo $row_start . $options['birth_date_label'] . $new_cell . $birth_date . $row_end; 188 if( 0 != mstw_safe_get( 'show_birth_date', $options, 0 ) ) { 189 ?> 190 <tr> 191 <td class="lf-col"><?php echo esc_html( $options['birth_date_label'] ) ?></td> 192 <td class="rt-col"><?php echo esc_html( $birth_date ) ?></td> 193 </tr> 194 <?php 174 195 } 175 196 176 197 // HOMETOWN 177 if( $options['show_home_town'] ) { 178 echo $row_start . $options['home_town_label'] . $new_cell . $home_town . $row_end; 198 if( 0 != mstw_safe_get( 'show_home_town', $options, 0 ) ) { 199 ?> 200 <tr> 201 <td class="lf-col"><?php echo esc_html( $options['home_town_label'] ) ?></td> 202 <td class="rt-col"><?php echo esc_html( $home_town ) ?></td> 203 </tr> 204 <?php 179 205 } 180 206 181 207 // HIGH SCHOOL 182 if( $options['show_high_school'] ) { 183 echo $row_start . $options['high_school_label'] . $new_cell . $high_school . $row_end; 184 } 185 208 if( 0 != mstw_safe_get( 'show_high_school', $options, 0 ) ) { 209 ?> 210 <tr> 211 <td class="lf-col"><?php echo esc_html( $options['high_school_label'] ) ?></td> 212 <td class="rt-col"><?php echo esc_html( $high_school ) ?></td> 213 </tr> 214 <?php 215 } 216 186 217 // FAMILY 187 if( $options['show_family'] ) { 188 echo $row_start . $options['family_label'] . $new_cell . $family . $row_end; 189 } 190 218 if( 0 != mstw_safe_get( 'show_home_family', $options, 0 ) ) { 219 ?> 220 <tr> 221 <td class="lf-col"><?php echo esc_html( $options['family_label'] ) ?></td> 222 <td class="rt-col"><?php echo wp_kses_post( $family ) ?></td> 223 </tr> 224 <?php 225 } 191 226 ?> 192 227 … … 200 235 <?php if( get_the_content( ) != "" ) { ?> 201 236 202 <div class="coach-bio"> <!-- coach-bio-<?php echo $staff_slug;?> "> -->237 <div class="coach-bio"> <!-- coach-bio-<?php echo esc_html( $staff_slug ) ?> "> --> 203 238 204 239 <?php $profile_bio_heading_text = ($profile_bio_heading_text == '' ) ? __( 'Profile', 'coaching-staffs' ) : $profile_bio_heading_text; ?> 205 240 206 <h1><?php echo $profile_bio_heading_text?></h1>241 <h1><?php echo esc_html( $profile_bio_heading_text ) ?></h1> 207 242 208 243 <!--add the bio content (format it as desired in the post)--> -
coaching-staffs/trunk/theme-templates/taxonomy-staffs.php
r3215779 r3290731 8 8 * 9 9 * MSTW Wordpress Plugins (http://shoalsummitsolutions.com) 10 * Copyright 2015-2 4Mark O'Donnell ([email protected])10 * Copyright 2015-25 Mark O'Donnell ([email protected]) 11 11 * 12 12 * This program is free software: you can redistribute it and/or modify … … 24 24 *-------------------------------------------------------------------------*/ 25 25 26 //if ( !function_exists( 'mstw_cs_set_fields_by_format' ) ) {27 //echo '<p> mstw_text_ctrl does not exist. </p>';28 //echo '<p> path:' . WP_CONTENT_DIR . '/plugins/coaching-staff/includes/mstw-cs-utility-functions.php</p>';29 //require_once WP_CONTENT_DIR . '/plugins/coaching-staff/includes/mstw-cs-utility-functions.php';30 //};31 32 26 get_header(); 33 27 … … 35 29 $options = get_option( 'mstw_cs_options' ); 36 30 37 //$sp_main_text_color = $options['sp_main_text_color'];38 //$sp_main_bkgd_color = $options['sp_main_bkgd_color'];39 //$hide_weight = $options['tr_hide_weight'];40 41 42 // Get the right settings for the format43 //$settings = mstw_cs_set_fields_by_format( $format );44 45 //echo '<h2>REVISED OPTIONS</h2>';46 //$options = wp_parse_args( $settings, $options );47 //print_r( $options );48 49 //$show_title = 1; /* this will come from a setting */50 51 //$use_coach_links = $options['pg_use_coach_links'];52 53 31 // figure out the staff name - for the title (if shown) and for staff-based styles 54 $uri_array = explode( '/', $_SERVER['REQUEST_URI'] ); 55 $staff_slug = $uri_array[sizeof( $uri_array )-2]; 56 $term = get_term_by( 'slug', $staff_slug, 'staffs' ); 57 $staff_name = ''; 58 if( isset( $term->name ) ) 59 $staff_name = $term->name; 32 if ( isset( $_SERVER['REQUEST_URI'] ) ) { 33 $requestURI = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ); 34 $requestURI = rtrim( $requestURI,'/' ); 35 $staffSlug = substr($requestURI, strrpos ( $requestURI, '/' ) +1 ); 36 37 $term = get_term_by( 'slug', $staffSlug, 'staffs' ); 38 $staff_name = ''; 39 if( isset( $term->name ) ) 40 $staff_name = $term->name; 41 42 } else { 43 die( "fatal error encountered in taxonomy-staffs" ); 44 } 60 45 61 46 ?> … … 64 49 <div id="content-coach-gallery" role="main" > 65 50 66 <header class="page-header page-header-<?php echo $staff_slug?>">67 <?php if( $options['show_gallery_title'] == 1 ) {68 echo '<h1 class="staff-head-title staff-head-title-' . $staff_slug . '">' . $staff_name . '</h1>';69 } ?>51 <header class="page-header page-header-<?php echo esc_html( $staffSlug ) ?>"> 52 <?php if( mstw_safe_get( 'show_gallery_title', $options, 1 ) == 1 ) { ?> 53 <h1 class="staff-head-title staff-head-title-<?php echo esc_html( $staffSlug ) ?>"><?php echo esc_html( $staff_name ) ?></h1> 54 <?php } ?> 70 55 </header> 71 56 … … 91 76 $high_school = get_post_meta( $coach_id, 'mstw_cs_high_school', true ); 92 77 $family = nl2br( get_post_meta( $coach_id, 'mstw_cs_family', true ) ); 78 93 79 ?> 94 80 95 <div class="coach-tile coach-tile-<?php echo ( $staff_slug ) ?>">81 <div class="coach-tile coach-tile-<?php echo esc_html( $staffSlug ) ?>"> 96 82 97 83 <div class = "coach-photo"> … … 107 93 // Try to load default-photo-staff-slug.jpg, If it does not exst, 108 94 // Then load default-photo.jpg from the plugin --> 109 $photo_file = WP_PLUGIN_DIR . '/coaching-staffs/images/default-photo' . '-' . $staff _slug . '.jpg';95 $photo_file = WP_PLUGIN_DIR . '/coaching-staffs/images/default-photo' . '-' . $staffSlug . '.jpg'; 110 96 if ( file_exists( $photo_file ) ) { 111 $photo_file_url = plugins_url() . '/coaching-staffs/images/default-photo' . '-' . $staff _slug . '.jpg';112 $alt = __( 'Default image for', 'coaching-staffs' ) . ' ' . $staff _slug;97 $photo_file_url = plugins_url() . '/coaching-staffs/images/default-photo' . '-' . $staffSlug . '.jpg'; 98 $alt = __( 'Default image for', 'coaching-staffs' ) . ' ' . $staffSlug; 113 99 } 114 100 else { … … 122 108 $custom_coach_template = get_stylesheet_directory( ) . '/single-coach.php'; 123 109 $plugin_coach_template = dirname( __DIR__ ) . '/theme-templates/single-coach.php'; 124 //mstw_log_msg( "plugin template: $plugin_coach_template" );125 110 126 111 if ( file_exists( $custom_coach_template ) ) { … … 139 124 140 125 if ( $single_coach_template ) { 141 echo( '<a href="' . get_permalink( $coach_id ) . '?position='. $post->ID . '">' . '<img src="' . $photo_file_url . '" alt="' . $alt . '" width="' . $img_width . '" height="' . $img_height . '" /></a>' ); 126 ?> 127 <img src="<?php echo esc_url( $photo_file_url ) ?>" alt="<?php echo esc_html( $alt ) ?>" width="<?php echo esc_html( $img_width ) ?>" height="<?php echo esc_html( $img_height ) ?>" /> 128 <?php 142 129 } 143 130 else { 144 echo( '<img src="' . $photo_file_url . '" alt="' . $alt . '" width="' . $img_width . '" height="' . $img_height . '" />' ); 131 ?> 132 <img src="<?php echo esc_url( $photo_file_url ) ?>" alt="<?php echo esc_html( $alt ) ?>" width="<?php echo esc_html( $img_width ) ?>" height="<?php echo esc_html( $img_height ) ?>" /> 133 <?php 145 134 } 146 135 ?> … … 152 141 // See if the single-coach.php template is in the theme directory 153 142 // If so, add a link to the coach's name 154 if ( $single_coach_template) {155 $coach _html = '<a href="' . get_permalink( $coach_id ) . '?position='. $post->ID . '">';156 $coach_html .= get_the_title( $coach_id ) . '</a>';143 if ( true /*$single_coach_template*/ ) { 144 $coachURL = mstw_cs_build_coach_url( $post->ID, $coach_id ); 145 $coach_html = mstw_cs_build_coach_link_html( $coachURL, get_the_title( $coach_id ) ); 157 146 } 158 147 else { … … 163 152 164 153 <div class="coach-name-position"> 165 <h1><?php echo $coach_html?></h1>166 <?php if ( $options['show_position']== 1 ) { ?>167 <h2><?php echo $position?></h2>154 <h1><?php echo wp_kses_post( $coach_html ) ?></h1> 155 <?php if ( mstw_safe_get( 'show_position', $options, 1 ) == 1 ) { ?> 156 <h2><?php echo esc_html( $position ) ?></h2> 168 157 <?php } ?> 169 158 </div> … … 173 162 <tbody> 174 163 <?php 175 $row_start = '<tr><td class="lf-col">'; 176 $new_cell = ':</td><td class="rt-col">'; //colon is for the end of the title 177 $row_end = '</td></tr>'; 178 164 179 165 //EXPERIENCE 180 if( $options['show_experience'] ) { 181 echo $row_start . $options['experience_label'] . $new_cell . $experience . $row_end; 166 if( mstw_safe_get( 'show_experience', $options, 1 ) ) { 167 ?> 168 <tr> 169 <td class="lf-col"><?php echo esc_html( mstw_safe_get( 'experience_label', $options, __( 'Experience', 'coaching-staffs' ) ) ) ?></td> 170 <td class="rt-col"><?php echo esc_html( get_post_meta( $coach_id, 'mstw_cs_experience', true ) ) ?></td> 171 </tr> 172 <?php 182 173 } 183 174 184 175 //ALMA MATER 185 if( $options['show_alma_mater'] ) { 186 echo $row_start . $options['alma_mater_label'] . $new_cell . $alma_mater . $row_end; 187 } 188 176 if( mstw_safe_get( 'show_alma_mater', $options, 1 ) ) { 177 ?> 178 <tr> 179 <td class="lf-col"><?php echo esc_html( mstw_safe_get( 'alma_mater_label', $options, __( 'Alma Mater', 'coaching-staffs' ) ) ) ?></td> 180 <td class="rt-col"><?php echo esc_html( get_post_meta( $coach_id, 'mstw_cs_alma_mater', true ) ) ?></td> 181 </tr> 182 <?php 183 } 184 189 185 // DEGREE 190 if( $options['show_degree'] ) { 191 echo $row_start . $options['degree_label'] . $new_cell . $degree . $row_end; 186 if( mstw_safe_get( 'show_degree', $options, 1 ) ) { 187 ?> 188 <tr> 189 <td class="lf-col"><?php echo esc_html( mstw_safe_get( 'degree_label', $options, __( 'Degree', 'coaching-staffs' ) ) ) ?></td> 190 <td class="rt-col"><?php echo esc_html( get_post_meta( $coach_id, 'mstw_cs_degree', true ) ) ?></td> 191 </tr> 192 <?php 192 193 } 193 194 194 195 // BIRTH DATE 195 if( $options['show_birth_date'] ) { 196 echo $row_start . $options['birth_date_label'] . $new_cell . $birth_date . $row_end; 196 if( mstw_safe_get( 'show_birth_date', $options, 1 ) ) { 197 ?> 198 <tr> 199 <td class="lf-col"><?php echo esc_html( mstw_safe_get( 'birth_date_label', $options, __( 'Age', 'coaching-staffs' ) ) ) ?></td> 200 <td class="rt-col"><?php echo esc_html( get_post_meta( $coach_id, 'mstw_cs_birth_date', true ) ) ?></td> 201 </tr> 202 <?php 197 203 } 198 204 199 205 // HOMETOWN 200 if( $options['show_home_town'] ) { 201 echo $row_start . $options['home_town_label'] . $new_cell . $home_town . $row_end; 206 if( mstw_safe_get( 'show_home_town', $options, 0 ) ) { 207 ?> 208 <tr> 209 <td class="lf-col"><?php echo esc_html( mstw_safe_get( 'home_town_label', $options, __( 'Home Town', 'coaching-staffs' ) ) ) ?></td> 210 <td class="rt-col"><?php echo esc_html( get_post_meta( $coach_id, 'mstw_cs_home_town', true ) ) ?></td> 211 </tr> 212 <?php 202 213 } 203 214 204 215 // HIGH SCHOOL 205 if( $options['show_high_school'] ) { 206 echo $row_start . $options['high_school_label'] . $new_cell . $high_school . $row_end; 216 if( mstw_safe_get( 'show_high_school', $options, 0 ) ) { 217 ?> 218 <tr> 219 <td class="lf-col"><?php echo esc_html( mstw_safe_get( 'high_school_label', $options, __( 'High School', 'coaching-staffs' ) ) ) ?></td> 220 <td class="rt-col"><?php echo esc_html( get_post_meta( $coach_id, 'mstw_cs_high_school', true ) ) ?></td> 221 </tr> 222 <?php 207 223 } 208 224 209 225 // FAMILY 210 if( $options['show_family'] ) { 211 echo $row_start . $options['family_label'] . $new_cell . $family . $row_end; 212 } 213 226 if( mstw_safe_get( 'show_family', $options, 0 ) ) { 227 ?> 228 <tr> 229 <td class="lf-col"><?php echo esc_html( mstw_safe_get( 'family_label', $options, __( 'Family', 'coaching-staffs' ) ) ) ?></td> 230 <td class="rt-col"><?php echo esc_html( get_post_meta( $coach_id, 'mstw_cs_family', true ) ) ?></td> 231 </tr> 232 <?php 233 } 214 234 ?> 215 235
Note: See TracChangeset
for help on using the changeset viewer.