<?php
/* ==========================================================
  Testimonials
=========================================================== */
if ( !function_exists('confin_mission_items_function')) {
  function confin_mission_items_function( $atts, $content = NULL ) {
    extract($atts);
    if ( $title_size || $title_color ) {
      $title_style = ' style="';
      $title_style .= $title_size ? 'font-size: '. confin_plugin_check_px($title_size) .';': '';
      $title_style .= $title_color ? 'color: '.$title_color : '';
      $title_style .= '"';
    } else {
      $title_style = '';
    }

    if ( $desc_size || $desc_color ) {
      $desc_style = ' style="';
      $desc_style .= $desc_size ? 'font-size: '. confin_plugin_check_px($desc_size) .';': '';
      $desc_style .= $desc_color ? 'color: '.$desc_color : '';
      $desc_style .= '"';
    } else {
      $desc_style = '';
    }

     ob_start(); ?>
    <div class="mission-vision-section  <?php echo esc_attr( $class ); ?>">
     <div class="row mission-vision">
      <?php if ( $all_missions ) {
        foreach ( $all_missions as $key => $all_mission ) {
          if (isset($all_mission->title) && !empty( $all_mission->title )) {
         ?>
          <div class="col col-md-4">
            <div class="details">
              <h3 <?php echo wp_kses_post( $title_style ); ?>><?php echo esc_html( $all_mission->title ); ?></h3>
              <p <?php echo wp_kses_post( $desc_style ); ?>><?php echo esc_html( $all_mission->desc ); ?></p>
            </div>
          </div>
        <?php } } } ?>
      </div>
     </div>
     <?php
     return ob_get_clean();
  }
}
add_shortcode( 'mission_items', 'confin_mission_items_function' );
