Plugin Directory

Changeset 3290731


Ignore:
Timestamp:
05/10/2025 03:06:44 AM (10 months ago)
Author:
MarkODonnell
Message:

Submitting a corrected version 1.5

Location:
coaching-staffs/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • coaching-staffs/trunk/includes/mstw-admin-utils.php

    r3215779 r3290731  
    55 *
    66 *  MSTW Wordpress Plugins
    7  *  Copyright (C) 2013-24 Mark O'Donnell
     7 *  Copyright (C) 2013-25 Mark O'Donnell
    88 *  Contact me at http://shoalsummitsolutions.com
    99 *
     
    6464        $label = $args['label'];
    6565       
    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        }
    6876        //echo "<label for='$id'>$label</label> \n";
    6977
     
    8391 *---------------------------------------------------------------*/
    8492    function mstw_utl_text_ctrl( $args ) {
     93        //mstw_log_msg( "mstw_utl_text_ctrl: args:" );
     94        //mstw_log_msg( $args );
     95       
    8596        $id = $args['id'];
    8697        $name = $args['name'];
     
    8899        $label = $args['label'];
    89100       
    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
    91105        //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        }
    93112       
    94113    } //End: mstw_utl_text_ctrl
     
    109128 *---------------------------------------------------------------*/
    110129    function mstw_utl_checkbox_ctrl( $args ) {
     130        //mstw_log_msg( "mstw_utl_checkbox_ctrl:" );
     131       
    111132        $id =       $args['id'];
    112133        $name =     $args['name'];
     
    114135        $label =    $args['label'];
    115136       
    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        }
    120147       
    121148    }   //End: mstw_utl_checkbox_ctrl
     
    135162 *---------------------------------------------------------------*/
    136163    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,
    140168                                            ),
    141169                        'id' => $args['id'],
     
    157185 *   $args['name'] (string)     Name of input field
    158186 *   $args['value'] (string)    Current value of setting
    159  *   $args['label'] (string)    Default to use of setting is blank
     187 *   $args['label'] (string)    Default to use if setting is blank
    160188 *
    161189 *  Return - none. Output is echoed.
    162190 *---------------------------------------------------------------*/
    163191    function mstw_utl_select_option_ctrl( $args ) {
    164        
     192        //mstw_log_msg( "mstw_utl_select_option_ctrl: args: " );
     193        //mstw_log_msg( $args );
     194   
    165195        $options = $args['options'];
    166196        $name = $args['name'];
    167197        $id = $args['id'];
     198       
    168199        $curr_value = $args['value'];
    169200        $label = $args['label'];
    170201       
    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
    172206        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
    176211        }
    177212        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>" ) : "";
    181214       
    182215    }  //End: mstw_utl_select_option_ctrl
  • coaching-staffs/trunk/includes/mstw-coaching-staffs-admin.php

    r3215779 r3290731  
    66
    77/*-----------------------------------------------------------------------------------
    8 Copyright 2012-24  Mark O'Donnell  (email : [email protected])
     8Copyright 2012-25  Mark O'Donnell  (email : [email protected])
    99
    1010This program is free software: you can redistribute it and/or modify
     
    6060        wp_enqueue_style( 'wp-color-picker' );
    6161        //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 );
    6363    }
    6464
     
    7575    function mstw_cs_custom_css() {
    7676    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;}' .
    8080         '</style>';
    8181    }
     
    108108   
    109109    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   
    141146} //End: mstw_cs_restrict_positions_by_staff
    142147   
    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'),
    151158                        'mstw_cs_coach_ui',
    152159                        '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       
    156175        add_meta_box(   'mstw-cs-staff-position-meta',
    157176                        __('Staff Position', 'coaching-staffs'),
    158177                        'mstw_cs_staff_position_ui',
    159178                        'staff_position',
    160                         'normal',
     179                        'advanced',
    161180                        '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 }
    163206
    164207    // ----------------------------------------------------------------------
     
    167210   
    168211    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           
    169216        // Retrieve the metadata values if they exist
    170217        $experience = get_post_meta( $post->ID, 'mstw_cs_experience', true );
     
    176223        $family = get_post_meta( $post->ID, 'mstw_cs_family', true );   
    177224        ?> 
    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>
    216262       
    217263    </table>
     
    225271   
    226272    function mstw_cs_staff_position_ui( $post ) {
     273        //mstw_log_msg( "mstw_cs_staff_position_ui:" );
     274       
    227275        // Retrieve the metadata values if they exist
    228276        $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 );
    230280        ?> 
    231281       
     
    237287            <select name="mstw_cs_position_coach" > <!--onchange='document.location.href=this.options[this.selectedIndex].value;'> -->
    238288                 <option value="">
    239                 <?php echo esc_attr( __( 'Select coach', 'coaching-staffs' ) ); ?></option>
     289                <?php esc_html_e( 'Select coach', 'coaching-staffs' ) ?></option>
    240290                 <?php
    241291                 $args = array(
     
    253303                                'post_parent'      => '',
    254304                                'post_status'      => 'publish',
    255                                 'suppress_filters' => true );
     305                                'suppress_filters' => false /*true*/ );
    256306                  $coaches = get_posts( $args );
    257307                         
    258308                  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
    264313                  }
    265314                ?>
     
    269318                       
    270319            <tr valign="top">
    271                 <th scope="row"><label for="mstw_cs_display_order" ><?php echo( __( '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>
    272321                <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>
    274323            </tr>
    275324           
     
    278327    <?php
    279328    }
    280 
    281329
    282330    // ----------------------------------------------------------------------
     
    285333
    286334    function mstw_cs_save_meta_data( $post_id ) {
     335        //mstw_log_msg( "mstw_cs_save_meta_data:" );
     336       
    287337        global $typenow;
    288338       
     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
    289351        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            }
    290355            //Strip tags for safety before storing strings     
    291356            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 ) ) );
    293358                   
    294359            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 ) ) );
    296361                   
    297362            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 ) ) );
    299364                   
    300365            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 ) ) );
    302367                   
    303368            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 ) ) );
    305370                   
    306371            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 ) ) );
    308373
    309374            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 ) ) );       
    311376        }
    312377        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            }
    313381            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 ) ) );
    315383                   
    316384            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 ) ) );
    318386        }
    319     }
     387       
     388    } //End: mstw_cs_save_meta_data( )
    320389   
    321390
     
    357426                else {
    358427                    $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
    360432                   
    361433                }
     
    363435               
    364436            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 ) );
    366438                break;
    367439               
    368440            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 ) );
    370442                break;
    371443       
    372444               
    373445            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 ) );
    375447                break;
    376448               
    377449            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 ) );
    379451                break;
    380452
    381453            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 ) );
    383455                break;
    384456               
    385457            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 ) );
    387459                break;
    388460               
    389461            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 ) ) );
    391463                break;
    392464               
     
    429501                        $staffs[$key] =  $staff->name;
    430502                    }
    431                     echo implode( ' | ', $staffs );
     503                    echo esc_html( implode( ' | ', $staffs ) );
    432504                }
    433505                break;
     
    435507            case 'coach' :
    436508                $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 ) );
    438510                break;
    439511               
    440512            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 ) );
    442515                break;
    443516               
     
    486559            <?php //settings_errors(); ?>
    487560            <form action="options.php" method="post">
     561                <?php wp_nonce_field( 'display-settings', 'mstw-cs-nonce' ); ?>
    488562                <?php settings_fields( 'mstw_cs_settings_fields' ); ?>
    489563                <?php do_settings_sections( 'mstw-cs-display-settings' ); ?>
    490564                <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" ); ?> />
    492566               
    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>
    495569                </p>
    496570            </form>
     
    505579
    506580    function mstw_cs_admin_init( ){
     581        //mstw_log_msg( "mstw_cs_admin_init:" );
     582       
    507583        $options = get_option( 'mstw_cs_options' );
    508584        $options = wp_parse_args( $options, mstw_cs_get_defaults( ) );
    509         //print_r ($options);
    510585       
    511586        // Settings for the fields and columns display and label controls.
     
    532607    // Data field visibility and labels
    533608    function mstw_cs_data_fields_setup( ) {
     609        //mstw_log_msg( "mstw_cs_data_fields_setup:" );
     610       
    534611        $display_page = 'mstw-cs-display-settings';     //menu page slug on which to display
    535612        $page_section = 'mstw_cs_data_field_settings';  //page section slug on which to display
    536613       
    537614        $options = get_option( 'mstw_cs_options' );
    538        
     615
    539616        add_settings_section(
    540617            $page_section,      //id attribute of tags
    541             __( 'Data Field Settings', 'coaching-staffs' ), //title of the section
     618            esc_html__( 'Data Field Settings', 'coaching-staffs' ), //title of the section
    542619            'mstw_cs_data_fields_settings_text',    //callback to fill section with desired output - should echo
    543620            $display_page   //page slug on which to display
     
    560637            );
    561638       
    562        
    563639        //Show/Hide Position
    564640        $args = array(  'id' => 'show_position',
    565641                        'name' => 'mstw_cs_options[show_position]',
    566                         'value' => $options['show_position'],
     642                        'value' => mstw_safe_get( 'show_position', $options, 1 ),
    567643                        'label' => ''
    568644                        );
     
    576652            $args                           //Callback arguments
    577653            );
    578            
    579            
    580654           
    581655        //Position Label
     
    598672        $args = array(  'id' => 'show_experience',
    599673                        'name' => 'mstw_cs_options[show_experience]',
    600                         'value' => $options['show_experience'],
     674                        'value' => mstw_safe_get( 'show_experience', $options, 1 ),
    601675                        'label' => ''
    602676                        );
     
    630704        $args = array(  'id' => 'show_alma_mater',
    631705                        'name' => 'mstw_cs_options[show_alma_mater]',
    632                         'value' => $options['show_alma_mater'],
     706                        'value' => mstw_safe_get( 'show_alma_mater', $options, 1 ),
    633707                        'label' => ''
    634708                        );
     
    662736        $args = array(  'id' => 'show_degree',
    663737                        'name' => 'mstw_cs_options[show_degree]',
    664                         'value' => $options['show_degree'],
     738                        'value' => mstw_safe_get( 'show_degree', $options, 0 ),
    665739                        'label' => ''
    666740                        );
     
    694768        $args = array(  'id' => 'show_birth_date',
    695769                        'name' => 'mstw_cs_options[show_birth_date]',
    696                         'value' => $options['show_birth_date'],
     770                        'value' => mstw_safe_get( 'show_birth_date', $options, 0 ),
    697771                        'label' => ''
    698772                        );
     
    726800        $args = array(  'id' => 'show_home_town',
    727801                        'name' => 'mstw_cs_options[show_home_town]',
    728                         'value' => $options['show_home_town'],
     802                        'value' => mstw_safe_get( 'show_home_town', $options, 0 ),
    729803                        'label' => ''
    730804                        );
     
    758832        $args = array(  'id' => 'show_high_school',
    759833                        'name' => 'mstw_cs_options[show_high_school]',
    760                         'value' => $options['show_high_school'],
     834                        'value' => mstw_safe_get( 'show_high_school', $options, 0 ),
    761835                        'label' => ''
    762836                        );
     
    771845            ); 
    772846           
    773         //Hometown Label
     847        //High School Label
    774848        $args = array(  'id' => 'high_school_label',
    775849                        'name' => 'mstw_cs_options[high_school_label]',
     
    790864        $args = array(  'id' => 'show_family',
    791865                        'name' => 'mstw_cs_options[show_family]',
    792                         'value' => $options['show_family'],
     866                        'value' => mstw_safe_get( 'show_family', $options, 0 ),
    793867                        'label' => ''
    794868                        );
     
    803877            ); 
    804878           
    805         //Hometown Label
     879        //Family Label
    806880        $args = array(  'id' => 'family_label',
    807881                        'name' => 'mstw_cs_options[family_label]',
     
    873947        add_settings_field(
    874948            'table_title_color',
    875             __( 'Table Title Color:', 'coaching-staffs' ),
     949            esc_html__( 'Table Title Color:', 'coaching-staffs' ),
    876950            'mstw_utl_color_ctrl',
    877951            $display_page,                  //Page to display field
     
    884958                        'name' => 'mstw_cs_options[show_photos]',
    885959                        //'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 ),
    887961                        'label' => __( 'Will show coaches photos in the staff tables', 'coaching-staffs')
    888962                        );
     
    10901164        );     
    10911165       
    1092     }
     1166    } //End: mstw_cs_table_settings_setup( )
    10931167   
    10941168    // --------------------------------------------------------------------------------------
     
    12831357        );
    12841358       
     1359        $showGalleryTitle = mstw_safe_get( 'show_gallery_title', $options, 0 );
    12851360        // Show/Hide Gallery Title
    12861361        $args = array(  'id' => 'show_gallery_title',
    12871362                        'name' => 'mstw_cs_options[show_gallery_title]',
    1288                         'value' => $options['show_gallery_title'],
     1363                        'value' => $showGalleryTitle, /*$options['show_gallery_title'],*/
    12891364                        'label' => __( 'Will use "Staff Name" from Staff taxonomy as default. Hide to use another page element for the table title.', 'coaching-staffs')
    12901365                        );
    1291                        
     1366       
    12921367        add_settings_field(
    12931368            'show_gallery_title',
     
    13161391       
    13171392        //Tile Corner Style
     1393        $galleryTileRadius = mstw_safe_get( 'gagallery_tile_radius', $options, 0 );
    13181394        $args = array(  'id' => 'gallery_tile_radius',
    13191395                        'name' => 'mstw_cs_options[gallery_tile_radius]',
    1320                         'value' => $options['gallery_tile_radius'],
     1396                        'value' => $galleryTileRadius, /*$options['gallery_tile_radius'],*/
    13211397                        'label' => __( 'Default is rounded.', 'coaching-staffs' ),
    13221398                        'options' => array( __( 'Rounded', 'coaching-staffs' ) => 15,
     
    14001476
    14011477    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>';   
    14031479    }
    14041480
    14051481    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>';
    14071483    }
    14081484
    14091485    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>';
    14111487    }
    14121488   
    14131489    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>';
    14151491    }
    14161492     
    14171493    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
    14191497        $output = array();
     1498       
    14201499        // Pull the previous (good) options
    14211500        $options = get_option( 'mstw_cs_options' );
     
    14231502        if ( array_key_exists( 'reset', $input ) ) {
    14241503            if ( $input['reset'] ) {
     1504                    delete_option( 'mstw_cs_options' );
    14251505                    $output = mstw_cs_get_defaults( );
    14261506                    return $output;
     
    14901570                    case 'show_photos':
    14911571                        $output[$key] = ( isset( $input[$key] ) and  $input[$key] == 1 ) ? 1 : 0;
    1492                         //mstw_log_msg( 'saving ' . $key . '... input= ' . $input[$key] . ' output= ' . $output[$key] );
    14931572                        break;
    14941573                       
     
    15041583       
    15051584        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;
    15101589        return $foo;
    15111590    }
     
    15641643       
    15651644        $messages['coach'] = array(
     1645            /* translators: %s number of items */
    15661646            'updated'   => _n( '%s coach updated.', '%s coaches updated.', $bulk_counts['updated'], 'coaching-staffs' ),
     1647            /* translators: %s number of items */
    15671648            '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 */
    15681650            'deleted'   => _n( '%s coach permanently deleted.', '%s coaches permanently deleted.', $bulk_counts['deleted'], 'coaching-staffs' ),
     1651            /* translators: %s number of items */
    15691652            '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 */
    15701654            'untrashed' => _n( '%s coach restored from the Trash.', '%s coaches restored from the Trash.', $bulk_counts['untrashed'], 'coaching-staffs' ),
    15711655        );
    15721656       
    15731657        $messages['staff_position'] = array(
     1658            /* translators: %s number of items */
    15741659            'updated'   => _n( '%s position updated.', '%s positions updated.', $bulk_counts['updated'], 'coaching-staffs' ),
     1660            /* translators: %s number of items */
    15751661            '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 */
    15761663            'deleted'   => _n( '%s position permanently deleted.', '%s positions permanently deleted.', $bulk_counts['deleted'], 'coaching-staffs' ),
     1664            /* translators: %s number of items */
    15771665            '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 */
    15781667            'untrashed' => _n( '%s position restored from the Trash.', '%s positions restored from the Trash.', $bulk_counts['untrashed'], 'coaching-staffs' ),
    15791668        );
  • coaching-staffs/trunk/includes/mstw-cs-utility-functions.php

    r3215779 r3290731  
    3434//          None. Outputs to WP error_log
    3535//
    36 if ( !function_exists( 'mstw_log_msg' ) ) {
     36/*if ( !function_exists( 'mstw_log_msg' ) ) {
    3737    function mstw_log_msg( $msg ) {
    3838        if ( WP_DEBUG === true ) {
     
    4949    } //End: mstw_log_msg( )
    5050}
    51 
     51*/
    5252//---------------------------------------------------------------------------------
    5353//  2. mstw_cs_get_defaults: returns the array of option defaults
     
    7474                'birth_date_label'      => __( 'Born', 'coaching-staffs' ),
    7575                'show_birth_date'       => 0,
    76                 'home_town_label'       => __( 'Hometown', 'coaching-staffs' ),
     76                'home_town_label'       => __( 'Home Town', 'coaching-staffs' ),
    7777                'show_home_town'        => 0,
    7878                'high_school_label'     => __( 'High School', 'coaching-staffs' ),
     
    130130    } //End: mstw_cs_find_staff_position( )
    131131}
     132
     133/*---------------------------------------------------------------------------------*/
     134//  4. mstw_cs_build_coach_link_html:
     135//      ARGUMENTS:
     136//      RETURNS  :
     137// 
     138if ( !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// 
     153if ( !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// 
     168if ( !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*/
    132196?>
  • coaching-staffs/trunk/includes/mstw-utility-functions.php

    r3215779 r3290731  
    55 *
    66 *  MSTW Wordpress Plugins (http://shoalsummitsolutions.com)
    7  *  Copyright 2014-24 Mark O'Donnell ([email protected])
     7 *  Copyright 2014-25 Mark O'Donnell ([email protected])
    88 *
    99 *  This program is free software: you can redistribute it and/or modify
     
    2626 * 1. mstw_log_msg - writes debug messages to /wp-content/debug.log
    2727 *                   if the WP_DEBUG settings in wp-config are correct
    28  * 2. mstw_requires_wordpress_version - checks for the right WordPress version
     28 * 2. mstw_requires_wordpress_version - removed from coaching staffs
    2929 * 3. mstw_safe_ref - prevents uninitialized string errors
    3030 * 3.   mstw_safe_get - Safely get value for a key from an array
     
    6060//          None. Outputs to WP error_log
    6161//
     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 */
    6267if ( !function_exists( 'mstw_log_msg' ) ) {
    6368    function mstw_log_msg( $msg ) {
     
    8489//  THIS FUNCTION ONLY WORKS IN ADMIN (because it calls get_plugin_data()
    8590//
    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 
    10595// ----------------------------------------------------------------
    10696// 3. mstw_safe_ref - prevents uninitialized string errors
     
    130120if ( !function_exists ( 'mstw_safe_get' ) ) {
    131121    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" );
    134123       
    135124        if ( array_key_exists( $needle, $haystack ) ) {
     
    180169    function mstw_date_loc($format, $timestamp = null) {
    181170        $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' ) );
    189178       
    190179        $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' ) );
    198187                           
    199188        $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' ) );
    212201                           
    213202        $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' ) );
    226215       
    227216        $return = '';
     
    238227                    break;
    239228                case 'D' :
    240                     $return .= $param_D[date('N', $timestamp)];
     229                    $return .= $param_D[gmdate('N', $timestamp)];
    241230                    break;
    242231                case 'l' :
    243                     $return .= $param_l[date('N', $timestamp)];
     232                    $return .= $param_l[gmdate('N', $timestamp)];
    244233                    break;
    245234                case 'F' :
    246                     $return .= $param_F[date('n', $timestamp)];
     235                    $return .= $param_F[gmdate('n', $timestamp)];
    247236                    break;
    248237                case 'M' :
    249                     $return .= $param_M[date('n', $timestamp)];
     238                    $return .= $param_M[gmdate('n', $timestamp)];
    250239                    break;
    251240                default :
    252                     $return .= date($format[$i], $timestamp);
     241                    $return .= gmdate($format[$i], $timestamp);
    253242                    break;
    254243            }
     
    269258//      'curr_value' => current field value,
    270259//      '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', ... )
    272261//      'label_for'  => $id,
    273262//      'class'      => $class,
     
    275264//  );
    276265//
    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'] : '&nbsp;&nbsp;';
    284                 ?>
    285                 <tr class='mstw-divider-spacer'><td>&nbsp;&nbsp;</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 */
    324269
    325270//-------------------------------------------------------------------------------
     
    333278//      'curr_value' => current field value,
    334279//      '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', ... )
    336281//      'label_for'  => $id,
    337282//      'class'      => $class,
     
    340285//     
    341286//
    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 */
    510290//-------------------------------------------------------------------------------
    511291// 8. mstw_build_settings_screen - builds admin settings form (using settings api)
     
    515295//          None. HTML is ouput/echoed to the screen by mstw_build_settings_field()
    516296//
    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 */
    524300
    525301//-------------------------------------------------------------------------------
     
    532308//          None. HTML is output/echoed to screen
    533309//     
    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 */
    676313
    677314//-------------------------------------------------------------------------------
     
    734371        }
    735372        else {
    736             //mstw_log_msg( 'in mstw_validate_url ... got a bad URL: ' . $url );
    737373            // url is not valid, display an error message (dont' update DB)
    738374            $notice .= ' ' . $url;         
     
    744380}
    745381
    746 //-------------------------------------------------------------------------------
     382/*//-------------------------------------------------------------------------------
    747383// 13. mstw_get_current_post_type - get the current post type in the WordPress Admin
    748384//      ARGUMENTS:
     
    765401        elseif( $current_screen and $current_screen->post_type )
    766402            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           
    768408        elseif( isset( $_REQUEST['post_type'] ) )
    769409            return sanitize_key( $_REQUEST['post_type'] );
     
    774414    } //End: mstw_get_current_post_type( )
    775415}
     416*/
    776417
    777418//-------------------------------------------------------------------------------
     
    869510                $msg_type = ( $msg_type == 'warning' ) ? $msg_type . ' updated' : $msg_type ;
    870511            ?>
    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>
    873514                </div>
    874515           
     
    892533//
    893534if ( !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                                                                                                                                                               
    895541        //default type to 'updated'
    896542        if ( !( $type == 'updated' or $type == 'error' or $type =='update-nag' or $type == 'warning' ) ) $type = 'updated';
     
    936582//
    937583if( 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            */
    940590        $cap = array( 'edit_', 'read_', 'delete_' );
    941591        $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  
    33msgstr ""
    44"Project-Id-Version: MSTW Coaching Staffs\n"
    5 "POT-Creation-Date: 2024-12-30 14:08-0600\n"
     5"POT-Creation-Date: 2025-05-07 13:58-0500\n"
    66"PO-Revision-Date: 2015-01-23 20:31-0800\n"
    77"Last-Translator: \n"
     
    1212"Content-Transfer-Encoding: 8bit\n"
    1313"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    14 "X-Generator: Poedit 3.5\n"
     14"X-Generator: Poedit 3.6\n"
    1515"X-Poedit-Basepath: .\n"
    1616"X-Poedit-KeywordsList: __;_e\n"
     
    1919"X-Poedit-SearchPath-2: ../theme-templates\n"
    2020
    21 #: ../includes/mstw-admin-utils.php:138
    22 #: ../includes/mstw-utility-functions.php:570
     21#: ../includes/mstw-admin-utils.php:167
    2322msgid "Show"
    2423msgstr ""
    2524
    26 #: ../includes/mstw-admin-utils.php:139
    27 #: ../includes/mstw-utility-functions.php:571
     25#: ../includes/mstw-admin-utils.php:168
    2826msgid "Hide"
    2927msgstr ""
    3028
    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
     30msgid "Coach Data"
     31msgstr ""
     32
     33#: ../includes/mstw-coaching-staffs-admin.php:176
     34msgid "Staff Position"
     35msgstr ""
     36
     37#: ../includes/mstw-coaching-staffs-admin.php:399
     38#: ../includes/mstw-cs-utility-functions.php:65
     39msgid "Name"
     40msgstr ""
     41
     42#: ../includes/mstw-coaching-staffs-admin.php:400
     43#: ../includes/mstw-cs-utility-functions.php:64
     44msgid "Photo"
     45msgstr ""
     46
     47#: ../includes/mstw-coaching-staffs-admin.php:401
     48#: ../includes/mstw-cs-utility-functions.php:70
     49#: ../theme-templates/taxonomy-staffs.php:179
     50msgid "Alma Mater"
     51msgstr ""
     52
     53#: ../includes/mstw-coaching-staffs-admin.php:402
     54#: ../includes/mstw-cs-utility-functions.php:68
     55#: ../theme-templates/taxonomy-staffs.php:169
     56msgid "Experience"
     57msgstr ""
     58
     59#: ../includes/mstw-coaching-staffs-admin.php:403
     60#: ../includes/mstw-cs-utility-functions.php:72
     61#: ../theme-templates/taxonomy-staffs.php:189
     62msgid "Degree"
     63msgstr ""
     64
     65#: ../includes/mstw-coaching-staffs-admin.php:404
     66msgid "Birth Date"
     67msgstr ""
     68
     69#: ../includes/mstw-coaching-staffs-admin.php:405
     70#: ../includes/mstw-cs-utility-functions.php:76
     71#: ../theme-templates/taxonomy-staffs.php:209
     72msgid "Home Town"
     73msgstr ""
     74
     75#: ../includes/mstw-coaching-staffs-admin.php:406
     76#: ../includes/mstw-cs-utility-functions.php:78
     77#: ../theme-templates/taxonomy-staffs.php:219
     78msgid "High School"
     79msgstr ""
     80
     81#: ../includes/mstw-coaching-staffs-admin.php:407
     82#: ../includes/mstw-cs-utility-functions.php:80
     83#: ../theme-templates/taxonomy-staffs.php:229
     84msgid "Family"
     85msgstr ""
     86
     87#: ../includes/mstw-coaching-staffs-admin.php:479
     88#: ../includes/mstw-cs-utility-functions.php:66
     89msgid "Position"
     90msgstr ""
     91
     92#: ../includes/mstw-coaching-staffs-admin.php:480
     93msgid "Staff"
     94msgstr ""
     95
     96#: ../includes/mstw-coaching-staffs-admin.php:482
    4197msgid "Coach"
    4298msgstr ""
    4399
    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
    116101msgid "MSTW Coaching Staffs"
    117102msgstr ""
    118103
    119 #: ../includes/mstw-coaching-staffs-admin.php:508
    120 #: ../includes/mstw-coaching-staffs-admin.php:517
     104#: ../includes/mstw-coaching-staffs-admin.php:529
     105#: ../includes/mstw-coaching-staffs-admin.php:538
    121106msgid "Coaching Staffs"
    122107msgstr ""
    123108
    124 #: ../includes/mstw-coaching-staffs-admin.php:518
     109#: ../includes/mstw-coaching-staffs-admin.php:539
    125110msgid "Staffs"
    126111msgstr ""
    127112
    128 #: ../includes/mstw-coaching-staffs-admin.php:525
     113#: ../includes/mstw-coaching-staffs-admin.php:546
    129114msgid "Coaching Staffs Display Settings"
    130115msgstr ""
    131116
    132 #: ../includes/mstw-coaching-staffs-admin.php:526
     117#: ../includes/mstw-coaching-staffs-admin.php:547
    133118msgid "Display Settings"
    134119msgstr ""
    135120
    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
    153122msgid "Name Label:"
    154123msgstr ""
    155124
    156 #: ../includes/mstw-coaching-staffs-admin.php:624
     125#: ../includes/mstw-coaching-staffs-admin.php:648
    157126msgid "Show Position:"
    158127msgstr ""
    159128
    160 #: ../includes/mstw-coaching-staffs-admin.php:642
     129#: ../includes/mstw-coaching-staffs-admin.php:664
    161130msgid "Position Label:"
    162131msgstr ""
    163132
    164 #: ../includes/mstw-coaching-staffs-admin.php:658
     133#: ../includes/mstw-coaching-staffs-admin.php:680
    165134msgid "Show Experience:"
    166135msgstr ""
    167136
    168 #: ../includes/mstw-coaching-staffs-admin.php:674
     137#: ../includes/mstw-coaching-staffs-admin.php:696
    169138msgid "Experience Label:"
    170139msgstr ""
    171140
    172 #: ../includes/mstw-coaching-staffs-admin.php:690
     141#: ../includes/mstw-coaching-staffs-admin.php:712
    173142msgid "Show Alma Mater:"
    174143msgstr ""
    175144
    176 #: ../includes/mstw-coaching-staffs-admin.php:706
     145#: ../includes/mstw-coaching-staffs-admin.php:728
    177146msgid "Alma Mater Label:"
    178147msgstr ""
    179148
    180 #: ../includes/mstw-coaching-staffs-admin.php:722
     149#: ../includes/mstw-coaching-staffs-admin.php:744
    181150msgid "Show Degree:"
    182151msgstr ""
    183152
    184 #: ../includes/mstw-coaching-staffs-admin.php:738
     153#: ../includes/mstw-coaching-staffs-admin.php:760
    185154msgid "Degree Label:"
    186155msgstr ""
    187156
    188 #: ../includes/mstw-coaching-staffs-admin.php:754
     157#: ../includes/mstw-coaching-staffs-admin.php:776
    189158msgid "Show Birth Date:"
    190159msgstr ""
    191160
    192 #: ../includes/mstw-coaching-staffs-admin.php:770
     161#: ../includes/mstw-coaching-staffs-admin.php:792
    193162msgid "Birth Date Label:"
    194163msgstr ""
    195164
    196 #: ../includes/mstw-coaching-staffs-admin.php:786
     165#: ../includes/mstw-coaching-staffs-admin.php:808
    197166msgid "Show Hometown:"
    198167msgstr ""
    199168
    200 #: ../includes/mstw-coaching-staffs-admin.php:802
     169#: ../includes/mstw-coaching-staffs-admin.php:824
    201170msgid "Hometown Label:"
    202171msgstr ""
    203172
    204 #: ../includes/mstw-coaching-staffs-admin.php:818
     173#: ../includes/mstw-coaching-staffs-admin.php:840
    205174msgid "Show High School:"
    206175msgstr ""
    207176
    208 #: ../includes/mstw-coaching-staffs-admin.php:834
     177#: ../includes/mstw-coaching-staffs-admin.php:856
    209178msgid "High School Label:"
    210179msgstr ""
    211180
    212 #: ../includes/mstw-coaching-staffs-admin.php:850
     181#: ../includes/mstw-coaching-staffs-admin.php:872
    213182msgid "Show Family:"
    214183msgstr ""
    215184
    216 #: ../includes/mstw-coaching-staffs-admin.php:866
     185#: ../includes/mstw-coaching-staffs-admin.php:888
    217186msgid "Family Label:"
    218187msgstr ""
    219188
    220 #: ../includes/mstw-coaching-staffs-admin.php:887
     189#: ../includes/mstw-coaching-staffs-admin.php:909
    221190msgid "Staff Table/[shortcode] Settings"
    222191msgstr ""
    223192
    224 #: ../includes/mstw-coaching-staffs-admin.php:903
    225 #: ../includes/mstw-coaching-staffs-admin.php:1341
     193#: ../includes/mstw-coaching-staffs-admin.php:925
     194#: ../includes/mstw-coaching-staffs-admin.php:1364
    226195msgid ""
    227196"Will use \"Staff Name\" from Staff taxonomy as default. Hide to use another "
     
    229198msgstr ""
    230199
    231 #: ../includes/mstw-coaching-staffs-admin.php:908
     200#: ../includes/mstw-coaching-staffs-admin.php:930
    232201msgid "Show Staff Table Titles:"
    233202msgstr ""
    234203
    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
    240205msgid "Will show coaches photos in the staff tables"
    241206msgstr ""
    242207
    243 #: ../includes/mstw-coaching-staffs-admin.php:944
     208#: ../includes/mstw-coaching-staffs-admin.php:966
    244209msgid "Show Photos:"
    245210msgstr ""
    246211
    247 #: ../includes/mstw-coaching-staffs-admin.php:956
     212#: ../includes/mstw-coaching-staffs-admin.php:978
    248213msgid "Set width in pixels for table photos, if shown. (Default: 80px)"
    249214msgstr ""
    250215
    251 #: ../includes/mstw-coaching-staffs-admin.php:961
     216#: ../includes/mstw-coaching-staffs-admin.php:983
    252217msgid "Table Photo Width:"
    253218msgstr ""
    254219
    255 #: ../includes/mstw-coaching-staffs-admin.php:972
     220#: ../includes/mstw-coaching-staffs-admin.php:994
    256221msgid "Set height in pixels for table photos, if shown. (Default: 80px)"
    257222msgstr ""
    258223
    259 #: ../includes/mstw-coaching-staffs-admin.php:977
     224#: ../includes/mstw-coaching-staffs-admin.php:999
    260225msgid "Table Photo Height:"
    261226msgstr ""
    262227
    263 #: ../includes/mstw-coaching-staffs-admin.php:993
     228#: ../includes/mstw-coaching-staffs-admin.php:1015
    264229msgid "Table Border Color:"
    265230msgstr ""
    266231
    267 #: ../includes/mstw-coaching-staffs-admin.php:1004
     232#: ../includes/mstw-coaching-staffs-admin.php:1026
    268233msgid "Set table border width in pixels (default:2px)"
    269234msgstr ""
    270235
    271 #: ../includes/mstw-coaching-staffs-admin.php:1009
     236#: ../includes/mstw-coaching-staffs-admin.php:1031
    272237msgid "Table Border Width:"
    273238msgstr ""
    274239
    275 #: ../includes/mstw-coaching-staffs-admin.php:1025
     240#: ../includes/mstw-coaching-staffs-admin.php:1047
    276241msgid "Table Header Background Color:"
    277242msgstr ""
    278243
    279 #: ../includes/mstw-coaching-staffs-admin.php:1041
     244#: ../includes/mstw-coaching-staffs-admin.php:1063
    280245msgid "Table Header Text Color:"
    281246msgstr ""
    282247
    283 #: ../includes/mstw-coaching-staffs-admin.php:1057
     248#: ../includes/mstw-coaching-staffs-admin.php:1079
    284249msgid "Table Even Row Text Color:"
    285250msgstr ""
    286251
    287 #: ../includes/mstw-coaching-staffs-admin.php:1073
     252#: ../includes/mstw-coaching-staffs-admin.php:1095
    288253msgid "Table Even Row Background Color:"
    289254msgstr ""
    290255
    291 #: ../includes/mstw-coaching-staffs-admin.php:1089
     256#: ../includes/mstw-coaching-staffs-admin.php:1111
    292257msgid "Table Even Row Link Color:"
    293258msgstr ""
    294259
    295 #: ../includes/mstw-coaching-staffs-admin.php:1105
     260#: ../includes/mstw-coaching-staffs-admin.php:1127
    296261msgid "Table Odd Row Text Color:"
    297262msgstr ""
    298263
    299 #: ../includes/mstw-coaching-staffs-admin.php:1121
     264#: ../includes/mstw-coaching-staffs-admin.php:1143
    300265msgid "Table Odd Row Background Color:"
    301266msgstr ""
    302267
    303 #: ../includes/mstw-coaching-staffs-admin.php:1137
     268#: ../includes/mstw-coaching-staffs-admin.php:1159
    304269msgid "Table Odd Row Link Color:"
    305270msgstr ""
    306271
    307 #: ../includes/mstw-coaching-staffs-admin.php:1156
     272#: ../includes/mstw-coaching-staffs-admin.php:1178
    308273msgid "Coach Profile Settings"
    309274msgstr ""
    310275
    311 #: ../includes/mstw-coaching-staffs-admin.php:1165
     276#: ../includes/mstw-coaching-staffs-admin.php:1187
    312277msgid "The text for the coach's profile bio heading."
    313278msgstr ""
    314279
    315 #: ../includes/mstw-coaching-staffs-admin.php:1170
     280#: ../includes/mstw-coaching-staffs-admin.php:1192
    316281msgid "Profile Heading:"
    317282msgstr ""
    318283
    319 #: ../includes/mstw-coaching-staffs-admin.php:1186
     284#: ../includes/mstw-coaching-staffs-admin.php:1208
    320285msgid "Header Background Color:"
    321286msgstr ""
    322287
    323 #: ../includes/mstw-coaching-staffs-admin.php:1202
     288#: ../includes/mstw-coaching-staffs-admin.php:1224
    324289msgid "Header Text Color:"
    325290msgstr ""
    326291
    327 #: ../includes/mstw-coaching-staffs-admin.php:1218
     292#: ../includes/mstw-coaching-staffs-admin.php:1240
    328293msgid "Name Color:"
    329294msgstr ""
    330295
    331 #: ../includes/mstw-coaching-staffs-admin.php:1234
     296#: ../includes/mstw-coaching-staffs-admin.php:1256
    332297msgid "Position Color:"
    333298msgstr ""
    334299
    335 #: ../includes/mstw-coaching-staffs-admin.php:1250
     300#: ../includes/mstw-coaching-staffs-admin.php:1272
    336301msgid "Bio Section Heading Color:"
    337302msgstr ""
    338303
    339 #: ../includes/mstw-coaching-staffs-admin.php:1266
     304#: ../includes/mstw-coaching-staffs-admin.php:1288
    340305msgid "Bio Section Text Color:"
    341306msgstr ""
    342307
    343 #: ../includes/mstw-coaching-staffs-admin.php:1282
     308#: ../includes/mstw-coaching-staffs-admin.php:1304
    344309msgid "Bio Section Background Color:"
    345310msgstr ""
    346311
    347 #: ../includes/mstw-coaching-staffs-admin.php:1298
     312#: ../includes/mstw-coaching-staffs-admin.php:1320
    348313msgid "Bio Section Border Color:"
    349314msgstr ""
    350315
    351 #: ../includes/mstw-coaching-staffs-admin.php:1309
     316#: ../includes/mstw-coaching-staffs-admin.php:1331
    352317msgid "Set bio border width in pixels (default:2px)"
    353318msgstr ""
    354319
    355 #: ../includes/mstw-coaching-staffs-admin.php:1314
     320#: ../includes/mstw-coaching-staffs-admin.php:1336
    356321msgid "Bio Section Border Width:"
    357322msgstr ""
    358323
    359 #: ../includes/mstw-coaching-staffs-admin.php:1332
     324#: ../includes/mstw-coaching-staffs-admin.php:1354
    360325msgid "Coaches Gallery Settings"
    361326msgstr ""
    362327
    363 #: ../includes/mstw-coaching-staffs-admin.php:1346
     328#: ../includes/mstw-coaching-staffs-admin.php:1369
    364329msgid "Show Gallery Title:"
    365330msgstr ""
    366331
    367 #: ../includes/mstw-coaching-staffs-admin.php:1362
     332#: ../includes/mstw-coaching-staffs-admin.php:1385
    368333msgid "Gallery Title Color:"
    369334msgstr ""
    370335
    371 #: ../includes/mstw-coaching-staffs-admin.php:1373
     336#: ../includes/mstw-coaching-staffs-admin.php:1397
    372337msgid "Default is rounded."
    373338msgstr ""
    374339
    375 #: ../includes/mstw-coaching-staffs-admin.php:1374
     340#: ../includes/mstw-coaching-staffs-admin.php:1398
    376341msgid "Rounded"
    377342msgstr ""
    378343
    379 #: ../includes/mstw-coaching-staffs-admin.php:1375
     344#: ../includes/mstw-coaching-staffs-admin.php:1399
    380345msgid "Square"
    381346msgstr ""
    382347
    383 #: ../includes/mstw-coaching-staffs-admin.php:1381
     348#: ../includes/mstw-coaching-staffs-admin.php:1405
    384349msgid "Gallery Tile Corner Style:"
    385350msgstr ""
    386351
    387 #: ../includes/mstw-coaching-staffs-admin.php:1392
     352#: ../includes/mstw-coaching-staffs-admin.php:1416
    388353msgid "Set width in pixels for gallery photos, if shown. (Default: 150px)"
    389354msgstr ""
    390355
    391 #: ../includes/mstw-coaching-staffs-admin.php:1397
     356#: ../includes/mstw-coaching-staffs-admin.php:1421
    392357msgid "Gallery Photo Width:"
    393358msgstr ""
    394359
    395 #: ../includes/mstw-coaching-staffs-admin.php:1408
     360#: ../includes/mstw-coaching-staffs-admin.php:1432
    396361msgid "Set height in pixels for gallery photos, if shown. (Default: 150px)"
    397362msgstr ""
    398363
    399 #: ../includes/mstw-coaching-staffs-admin.php:1413
     364#: ../includes/mstw-coaching-staffs-admin.php:1437
    400365msgid "Gallery Photo Height:"
    401366msgstr ""
    402367
    403 #: ../includes/mstw-coaching-staffs-admin.php:1429
     368#: ../includes/mstw-coaching-staffs-admin.php:1453
    404369msgid "Gallery Tile Border Color:"
    405370msgstr ""
    406371
    407 #: ../includes/mstw-coaching-staffs-admin.php:1440
     372#: ../includes/mstw-coaching-staffs-admin.php:1464
    408373msgid "Set border width in pixels. (Default: 2px)"
    409374msgstr ""
    410375
    411 #: ../includes/mstw-coaching-staffs-admin.php:1445
     376#: ../includes/mstw-coaching-staffs-admin.php:1469
    412377msgid "Gallery Tile Border Width:"
    413378msgstr ""
    414379
    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
    438382msgid "Coach updated."
    439383msgstr ""
    440384
    441 #: ../includes/mstw-coaching-staffs-admin.php:1579
    442 #: ../includes/mstw-coaching-staffs-admin.php:1593
     385#: ../includes/mstw-coaching-staffs-admin.php:1606
     386#: ../includes/mstw-coaching-staffs-admin.php:1620
    443387msgid "Custom field updated."
    444388msgstr ""
    445389
    446 #: ../includes/mstw-coaching-staffs-admin.php:1580
    447 #: ../includes/mstw-coaching-staffs-admin.php:1594
     390#: ../includes/mstw-coaching-staffs-admin.php:1607
     391#: ../includes/mstw-coaching-staffs-admin.php:1621
    448392msgid "Custom field deleted."
    449393msgstr ""
    450394
    451 #: ../includes/mstw-coaching-staffs-admin.php:1582
     395#: ../includes/mstw-coaching-staffs-admin.php:1609
    452396msgid "Coach restored to revision"
    453397msgstr ""
    454398
    455 #: ../includes/mstw-coaching-staffs-admin.php:1583
     399#: ../includes/mstw-coaching-staffs-admin.php:1610
    456400msgid "Coach published."
    457401msgstr ""
    458402
    459 #: ../includes/mstw-coaching-staffs-admin.php:1584
     403#: ../includes/mstw-coaching-staffs-admin.php:1611
    460404msgid "Coach saved."
    461405msgstr ""
    462406
    463 #: ../includes/mstw-coaching-staffs-admin.php:1585
     407#: ../includes/mstw-coaching-staffs-admin.php:1612
    464408msgid "Coach submitted."
    465409msgstr ""
    466410
    467 #: ../includes/mstw-coaching-staffs-admin.php:1586
     411#: ../includes/mstw-coaching-staffs-admin.php:1613
    468412msgid "Coach scheduled for publication."
    469413msgstr ""
    470414
    471 #: ../includes/mstw-coaching-staffs-admin.php:1587
     415#: ../includes/mstw-coaching-staffs-admin.php:1614
    472416msgid "Coach draft updated."
    473417msgstr ""
    474418
    475 #: ../includes/mstw-coaching-staffs-admin.php:1592
    476 #: ../includes/mstw-coaching-staffs-admin.php:1595
     419#: ../includes/mstw-coaching-staffs-admin.php:1619
     420#: ../includes/mstw-coaching-staffs-admin.php:1622
    477421msgid "Position updated."
    478422msgstr ""
    479423
    480 #: ../includes/mstw-coaching-staffs-admin.php:1596
     424#: ../includes/mstw-coaching-staffs-admin.php:1623
    481425msgid "Position restored to revision"
    482426msgstr ""
    483427
    484 #: ../includes/mstw-coaching-staffs-admin.php:1597
     428#: ../includes/mstw-coaching-staffs-admin.php:1624
    485429msgid "Position published."
    486430msgstr ""
    487431
    488 #: ../includes/mstw-coaching-staffs-admin.php:1598
     432#: ../includes/mstw-coaching-staffs-admin.php:1625
    489433msgid "Position saved."
    490434msgstr ""
    491435
    492 #: ../includes/mstw-coaching-staffs-admin.php:1599
     436#: ../includes/mstw-coaching-staffs-admin.php:1626
    493437msgid "Position submitted."
    494438msgstr ""
    495439
    496 #: ../includes/mstw-coaching-staffs-admin.php:1600
     440#: ../includes/mstw-coaching-staffs-admin.php:1627
    497441msgid "Position scheduled for publication."
    498442msgstr ""
    499443
    500 #: ../includes/mstw-coaching-staffs-admin.php:1601
     444#: ../includes/mstw-coaching-staffs-admin.php:1628
    501445msgid "Position draft updated."
    502446msgstr ""
    503447
    504 #: ../includes/mstw-cs-utility-functions.php:55
     448#: ../includes/mstw-cs-utility-functions.php:74
    505449msgid "Born"
    506450msgstr ""
    507451
    508 #: ../includes/mstw-cs-utility-functions.php:57
    509 msgid "Hometown"
     452#: ../includes/mstw-utility-functions.php:171
     453msgid "Mon"
     454msgstr ""
     455
     456#: ../includes/mstw-utility-functions.php:172
     457msgid "Tue"
     458msgstr ""
     459
     460#: ../includes/mstw-utility-functions.php:173
     461msgid "Wed"
     462msgstr ""
     463
     464#: ../includes/mstw-utility-functions.php:174
     465msgid "Thr"
     466msgstr ""
     467
     468#: ../includes/mstw-utility-functions.php:175
     469msgid "Fri"
     470msgstr ""
     471
     472#: ../includes/mstw-utility-functions.php:176
     473msgid "Sat"
     474msgstr ""
     475
     476#: ../includes/mstw-utility-functions.php:177
     477msgid "Sun"
     478msgstr ""
     479
     480#: ../includes/mstw-utility-functions.php:180
     481msgid "Monday"
     482msgstr ""
     483
     484#: ../includes/mstw-utility-functions.php:181
     485msgid "Tuesday"
    510486msgstr ""
    511487
    512488#: ../includes/mstw-utility-functions.php:182
    513 msgid "Mon"
     489msgid "Wednesday"
    514490msgstr ""
    515491
    516492#: ../includes/mstw-utility-functions.php:183
    517 msgid "Tue"
     493msgid "Thursday"
    518494msgstr ""
    519495
    520496#: ../includes/mstw-utility-functions.php:184
    521 msgid "Wed"
     497msgid "Friday"
    522498msgstr ""
    523499
    524500#: ../includes/mstw-utility-functions.php:185
    525 msgid "Thr"
     501msgid "Saturday"
    526502msgstr ""
    527503
    528504#: ../includes/mstw-utility-functions.php:186
    529 msgid "Fri"
    530 msgstr ""
    531 
    532 #: ../includes/mstw-utility-functions.php:187
    533 msgid "Sat"
    534 msgstr ""
    535 
    536 #: ../includes/mstw-utility-functions.php:188
    537 msgid "Sun"
     505msgid "Sunday"
     506msgstr ""
     507
     508#: ../includes/mstw-utility-functions.php:189
     509msgid "January"
     510msgstr ""
     511
     512#: ../includes/mstw-utility-functions.php:190
     513msgid "February"
    538514msgstr ""
    539515
    540516#: ../includes/mstw-utility-functions.php:191
    541 msgid "Monday"
     517msgid "March"
    542518msgstr ""
    543519
    544520#: ../includes/mstw-utility-functions.php:192
    545 msgid "Tuesday"
     521msgid "April"
    546522msgstr ""
    547523
    548524#: ../includes/mstw-utility-functions.php:193
    549 msgid "Wednesday"
     525#: ../includes/mstw-utility-functions.php:207
     526msgid "May"
    550527msgstr ""
    551528
    552529#: ../includes/mstw-utility-functions.php:194
    553 msgid "Thursday"
     530msgid "June"
    554531msgstr ""
    555532
    556533#: ../includes/mstw-utility-functions.php:195
    557 msgid "Friday"
     534msgid "July"
    558535msgstr ""
    559536
    560537#: ../includes/mstw-utility-functions.php:196
    561 msgid "Saturday"
     538msgid "August"
    562539msgstr ""
    563540
    564541#: ../includes/mstw-utility-functions.php:197
    565 msgid "Sunday"
     542msgid "September"
     543msgstr ""
     544
     545#: ../includes/mstw-utility-functions.php:198
     546msgid "October"
     547msgstr ""
     548
     549#: ../includes/mstw-utility-functions.php:199
     550msgid "November"
    566551msgstr ""
    567552
    568553#: ../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"
     554msgid "December"
    578555msgstr ""
    579556
    580557#: ../includes/mstw-utility-functions.php:203
    581 msgid "April"
     558msgid "Jan"
    582559msgstr ""
    583560
    584561#: ../includes/mstw-utility-functions.php:204
    585 #: ../includes/mstw-utility-functions.php:218
    586 msgid "May"
     562msgid "Feb"
    587563msgstr ""
    588564
    589565#: ../includes/mstw-utility-functions.php:205
    590 msgid "June"
     566msgid "Mar"
    591567msgstr ""
    592568
    593569#: ../includes/mstw-utility-functions.php:206
    594 msgid "July"
    595 msgstr ""
    596 
    597 #: ../includes/mstw-utility-functions.php:207
    598 msgid "August"
     570msgid "Apr"
    599571msgstr ""
    600572
    601573#: ../includes/mstw-utility-functions.php:208
    602 msgid "September"
     574msgid "Jun"
    603575msgstr ""
    604576
    605577#: ../includes/mstw-utility-functions.php:209
    606 msgid "October"
     578msgid "Jul"
    607579msgstr ""
    608580
    609581#: ../includes/mstw-utility-functions.php:210
    610 msgid "November"
     582msgid "Aug"
    611583msgstr ""
    612584
    613585#: ../includes/mstw-utility-functions.php:211
    614 msgid "December"
     586msgid "Sep"
     587msgstr ""
     588
     589#: ../includes/mstw-utility-functions.php:212
     590msgid "Oct"
     591msgstr ""
     592
     593#: ../includes/mstw-utility-functions.php:213
     594msgid "Nov"
    615595msgstr ""
    616596
    617597#: ../includes/mstw-utility-functions.php:214
    618 msgid "Jan"
    619 msgstr ""
    620 
    621 #: ../includes/mstw-utility-functions.php:215
    622 msgid "Feb"
    623 msgstr ""
    624 
    625 #: ../includes/mstw-utility-functions.php:216
    626 msgid "Mar"
    627 msgstr ""
    628 
    629 #: ../includes/mstw-utility-functions.php:217
    630 msgid "Apr"
    631 msgstr ""
    632 
    633 #: ../includes/mstw-utility-functions.php:219
    634 msgid "Jun"
    635 msgstr ""
    636 
    637 #: ../includes/mstw-utility-functions.php:220
    638 msgid "Jul"
    639 msgstr ""
    640 
    641 #: ../includes/mstw-utility-functions.php:221
    642 msgid "Aug"
    643 msgstr ""
    644 
    645 #: ../includes/mstw-utility-functions.php:222
    646 msgid "Sep"
    647 msgstr ""
    648 
    649 #: ../includes/mstw-utility-functions.php:223
    650 msgid "Oct"
    651 msgstr ""
    652 
    653 #: ../includes/mstw-utility-functions.php:224
    654 msgid "Nov"
    655 msgstr ""
    656 
    657 #: ../includes/mstw-utility-functions.php:225
    658598msgid "Dec"
    659599msgstr ""
    660600
    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
    804602msgid "No Staff Position"
    805603msgstr ""
    806604
    807 #: ../theme-templates/single-coach.php:128
    808 #: ../theme-templates/taxonomy-staffs.php:112
     605#: ../theme-templates/single-coach.php:133
     606#: ../theme-templates/taxonomy-staffs.php:98
    809607msgid "Default image for"
    810608msgstr ""
    811609
    812 #: ../theme-templates/single-coach.php:132
    813 #: ../theme-templates/taxonomy-staffs.php:116
     610#: ../theme-templates/single-coach.php:137
     611#: ../theme-templates/taxonomy-staffs.php:102
    814612msgid "Photo not found."
    815613msgstr ""
    816614
    817 #: ../theme-templates/single-coach.php:204
     615#: ../theme-templates/single-coach.php:239
    818616msgid "Profile"
    819617msgstr ""
    820618
    821 #: ../theme-templates/taxonomy-staffs.php:104
     619#: ../theme-templates/taxonomy-staffs.php:90
    822620msgid "Photo of"
    823621msgstr ""
     622
     623#: ../theme-templates/taxonomy-staffs.php:199
     624msgid "Age"
     625msgstr ""
  • coaching-staffs/trunk/mstw-coaching-staffs.php

    r3261151 r3290731  
    4141       
    4242        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', '' ) );
    4444        echo "} \n";
    4545       
    4646        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' ) );
    5151        echo "} \n";
    5252       
    5353        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' ) );
    5858        echo "} \n";
    5959       
    6060        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' ) );
    6262        echo "} \n";
    6363       
    6464        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' ) );
    6969        echo "} \n";
    7070       
    7171        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' ) );
    7373        echo "} \n";
    7474       
     
    7676        //Rules for Single Coach
    7777        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' ) );
    7979        echo "} \n";
    8080       
    8181        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' ) );
    8383        echo "} \n";
    8484       
    8585        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' ) );
    8787        echo "} \n";
    8888       
    8989        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' ) );
    9191        echo "} \n";
    9292         
    9393        //bio_heading_color
    9494        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' ) );
    9696        echo "} \n";
    9797        //bio_text_color
    9898        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' ) );
    100100        echo "} \n";
    101101        //bio_bkgd_color
    102102        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' ) );
    112106        echo "} \n";
    113107       
    114108        // Rules for Coaches Galleries
    115109        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' ) );
    124119            //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' ) );
    130125        echo "} \n";
    131126       
    132127        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' ) );
    135130        echo "} \n";
    136131       
    137132        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' ) );
    139134        echo "} \n";
    140135       
    141136        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         
    145140        echo '</style>';
    146141       
     
    181176        // Need to check the need for this first conditional ... someday
    182177
    183         if ( !is_admin() && $query->is_tax( 'staffs' ) && $query->is_main_query() ) {
     178        if ( !is_admin() && is_tax( 'staffs' ) && $query->is_main_query() ) {
    184179            // We are on the coach gallery page ...
    185180            // So set the sort order based on the admin settings
     
    187182           
    188183            // 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 );   
    190192            $staff_slug = $uri_array[sizeof( $uri_array )-2];
    191193           
     
    252254        $plugin_data = get_plugin_data( __FILE__, false );
    253255
    254         if ( version_compare($wp_version, "3.5", "<" ) ) {
     256        if ( version_compare($wp_version, "4.1", "<" ) ) {
    255257            if( is_plugin_active($plugin) ) {
    256258                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>." );
    259261            }
    260262        }
     
    278280        // If stylesheet exists, enqueue the style
    279281        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' );
    282283            wp_enqueue_style( 'mstw-cs-styles' );               
    283284        }
    284285
    285286        $mstw_cs_custom_stylesheet = get_stylesheet_directory( ) . '/mstw-cs-custom-styles.css';
    286         //mstw_log_msg( 'custom stylesheet path: ' . $mstw_cs_custom_stylesheet );
    287287       
    288288        if ( file_exists( $mstw_cs_custom_stylesheet ) ) {
    289289            $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' );
    292291            wp_enqueue_style( 'mstw_cs_custom_style' );
    293292        }
     
    365364            //'exclude_from_search' => false,
    366365            //'show_ui'             => true,
    367             'show_in_menu'          => 'mstw-cs-main-menu', //=> true,
     366            'show_in_menu'          => 'mstw-cs-main-menu', //=> true, 
    368367            //'menu_position'       => null,
    369368            //'menu_icon'           => null,
     
    432431    //mstw_log_msg( "mstw_cs_single_coach_template: $single_template" );
    433432    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') { 
    437437        $custom_coach_template = get_stylesheet_directory( ) . '/single-coach.php';
    438438        $plugin_coach_template = dirname( __FILE__ ) . '/theme-templates/single-coach.php';
    439         //mstw_log_msg( "plugin template: $plugin_coach_template" );
    440439       
    441440        if ( file_exists( $custom_coach_template ) ) {
    442441            $single_template = $custom_coach_template;
    443             //mstw_log_msg( "mstw_cs_single_coach_template: using custom template: $custom_coach_template" );
    444442        }
    445443        else if ( file_exists( $plugin_coach_template ) ) {
    446444            $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    }
    452447   
    453448    return $single_template;
     
    464459    //mstw_log_msg( "taxonomy: " . get_query_var( 'taxonomy' ) );
    465460   
     461    // Return value
     462    $template = null;
     463   
    466464    if ( 'staffs' == get_query_var( 'taxonomy' ) ) {   
    467465        $custom_taxonomy_template = get_stylesheet_directory( ) . '/taxonomy-staffs.php';
     
    470468        if ( file_exists( $custom_taxonomy_template ) ) {
    471469            $template = $custom_taxonomy_template;
    472             //mstw_log_msg( "using custom template: $custom_taxonomy_template" );
    473470        }
    474471        else if ( file_exists( $plugin_taxonomy_template ) ) {
    475472            $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 " );
    480473        } //End: if ( file_exists( $custom_taxonomy_template ) ) {
    481474           
    482475    } //End: if ( file_exists( $custom_taxonomy_template ) ) {
    483476       
    484     //mstw_log_msg( "returning template: $template" );   
    485477    return $template;
    486478         
     
    620612        }
    621613       
    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        }
    623627       
    624628        // Keeps track of even and odd rows. Start with row 1 = odd.
     
    642646            $coach_id = get_post_meta( $post->ID, 'mstw_cs_position_coach', true );
    643647
    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           
    655649
    656650            if ( $show_photos ) {
     
    659653                if ( has_post_thumbnail( $coach_id ) ) {
    660654                    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                       
    662667                        $row_string .= get_the_post_thumbnail( $coach_id, array($table_photo_width, $table_photo_height) ) .  '</a></td>';
    663668                    }
     
    682687           
    683688            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 );         
    687691            }
    688692            else {
  • coaching-staffs/trunk/readme.txt

    r3215779 r3290731  
    33Donate link: http://shoalsummitsolutions.com
    44Tags: sports,teams,coaches,staffs 
    5 Requires at least: 3.6
    6 Tested up to: 6.7.1
     5Requires at least: 5.2
     6Tested up to: 6.8
    77Stable tag: 1.5
    8 Requires PHP: 7.0
     8Requires PHP: 7.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • coaching-staffs/trunk/theme-templates/single-coach.php

    r3215779 r3290731  
    88 *
    99 *  MSTW Wordpress Plugins (http://shoalsummitsolutions.com)
    10  *  Copyright 2015-24 Mark O'Donnell ([email protected])
     10 *  Copyright 2015-25 Mark O'Donnell ([email protected])
    1111 *
    1212 *  This program is free software: you can redistribute it and/or modify
     
    2424 *-------------------------------------------------------------------------*/
    2525 ?>
    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       
    2742    <?php get_header();
    2843    //mstw_log_msg( "starting single-coach: current post ID = " . $post->ID ); ?>
     
    3146        <div id="content" role="main">
    3247
    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">&larr;</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(); ?>>
    5351
    5452                <?php
     
    5755               
    5856                // 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, '' ); 
    6058               
    6159                if ( $position_post ) {
    6260                    $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                    }
    6469                   
    6570                } else {
     
    101106                ?>
    102107       
    103                 <div class="coach-header <?php echo( $header_class ) ?>">
     108                <div class="coach-header <?php echo esc_url( $header_class ) ?>">
    104109                    <!-- First, figure out the coach's photo -->
    105110                    <div id = "coach-photo">
     
    115120   
    116121                        // check if the post has a Post Thumbnail assigned to it.
    117                          if ( has_post_thumbnail( ) ) { //defaults to current post
     122                        if ( has_post_thumbnail( ) ) { //defaults to current post
    118123                            //Get the photo file;
    119124                            $photo_file_url = wp_get_attachment_thumb_url( get_post_thumbnail_id( ) ); //defaults to current post
     
    133138                            }
    134139                        }
    135                        
    136                         echo( '<img src="' . $photo_file_url . '" alt="' . $alt . '" width="' . $img_width . '" height="' . $img_height . '" />' );
    137140                        ?>
     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                           
    138143                    </div> <!-- #coach-photo -->
    139144                   
    140                     <!-- Figure out the coach name and number -->
     145                    <!-- Figure out the coach name and position, which are always displayed -->
    141146                    <div id="coach-name-position">
    142147                        <div id="coach-name">
    143                         <h1><?php echo $name; ?></h1>
     148                        <h1><?php echo esc_html( $name ) ?></h1>
    144149                        <!-- get the position ID from the URL -->
    145                         <h2><?php echo $position; ?> </h2>
     150                        <h2><?php echo esc_html( $position ) ?> </h2>
    146151                        </div> <!-- #coach-name -->
    147                    
    148152                   
    149153                        <table class="coach-info">
    150154                        <tbody>
    151155                            <?php
    152                             $row_start = '<tr><td class="lf-col">';
    153                             $new_cell = ':</td><td class="rt-col">'; //colon is for the end of the title
    154                             $row_end = '</td></tr>';
    155                            
    156156                            //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
    159164                            }
    160165                           
    161166                            //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
    164175                            }
    165176                           
    166177                            // 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
    169185                            }
    170186                           
    171187                            // 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
    174195                            }
    175196                           
    176197                            // 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
    179205                            }
    180206                           
    181207                            // 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                               
    186217                            // 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                            }
    191226                            ?>
    192227                           
     
    200235                <?php if( get_the_content( ) != "" ) { ?>
    201236                   
    202                     <div class="coach-bio"> <!-- coach-bio-<?php echo $staff_slug; ?> "> -->
     237                    <div class="coach-bio"> <!-- coach-bio-<?php echo esc_html( $staff_slug ) ?> "> -->
    203238                   
    204239                        <?php $profile_bio_heading_text = ($profile_bio_heading_text == '' ) ? __( 'Profile', 'coaching-staffs' ) : $profile_bio_heading_text; ?>
    205240                       
    206                         <h1><?php echo $profile_bio_heading_text ?></h1>
     241                        <h1><?php echo esc_html( $profile_bio_heading_text ) ?></h1>
    207242
    208243                        <!--add the bio content (format it as desired in the post)-->
  • coaching-staffs/trunk/theme-templates/taxonomy-staffs.php

    r3215779 r3290731  
    88 *
    99 *  MSTW Wordpress Plugins (http://shoalsummitsolutions.com)
    10  *  Copyright 2015-24 Mark O'Donnell ([email protected])
     10 *  Copyright 2015-25 Mark O'Donnell ([email protected])
    1111 *
    1212 *  This program is free software: you can redistribute it and/or modify
     
    2424 *-------------------------------------------------------------------------*/
    2525 
    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  
    3226    get_header();
    3327   
     
    3529    $options = get_option( 'mstw_cs_options' );
    3630   
    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 format
    43     //$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    
    5331    // 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    }
    6045   
    6146    ?>
     
    6449    <div id="content-coach-gallery" role="main" >
    6550
    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 } ?>
    7055    </header>
    7156
     
    9176        $high_school = get_post_meta( $coach_id, 'mstw_cs_high_school', true );
    9277        $family = nl2br( get_post_meta( $coach_id, 'mstw_cs_family', true ) ); 
     78       
    9379        ?>
    9480       
    95         <div class="coach-tile coach-tile-<?php echo( $staff_slug ) ?>">
     81        <div class="coach-tile coach-tile-<?php echo esc_html( $staffSlug ) ?>">
    9682       
    9783            <div class = "coach-photo">
     
    10793                    // Try to load default-photo-staff-slug.jpg, If it does not exst,
    10894                    // 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';
    11096                    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;
    11399                    }
    114100                    else {
     
    122108                $custom_coach_template = get_stylesheet_directory( ) . '/single-coach.php';
    123109                $plugin_coach_template = dirname( __DIR__ ) . '/theme-templates/single-coach.php';
    124                 //mstw_log_msg( "plugin template: $plugin_coach_template" );
    125110               
    126111                if ( file_exists( $custom_coach_template ) ) {
     
    139124               
    140125                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
    142129                }
    143130                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
    145134                }
    146135                ?>
     
    152141                // See if the single-coach.php template is in the theme directory
    153142                // 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 ) );
    157146                }
    158147                else {
     
    163152               
    164153                <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>
    168157                    <?php } ?>
    169158                </div>
     
    173162                <tbody>
    174163                    <?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               
    179165                    //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
    182173                    }
    183174                   
    184175                    //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
    189185                    // 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
    192193                    }
    193194                   
    194195                    // 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
    197203                    }
    198204                   
    199205                    // 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
    202213                    }
    203214                   
    204215                    // 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
    207223                    }
    208224                   
    209225                    // 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                    }
    214234                    ?>
    215235                   
Note: See TracChangeset for help on using the changeset viewer.