| @@ -1,47 +1,91 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +/* | |
| 4 | +* @Author ParaTheme | |
| 5 | +* @Folder Team/Includes | |
| 6 | +* @version 3.0.5 | |
| 3 | 7 | |
| 8 | +* Copyright: 2015 ParaTheme | |
| 9 | +*/ | |
| 4 | 10 | |
| 5 | -if (!defined('ABSPATH')) exit; // if direct access | |
| 11 | +if ( ! defined('ABSPATH')) exit; // if direct access | |
| 6 | 12 | |
| 7 | 13 | |
| 8 | -class class_team_shortcodes | |
| 9 | -{ | |
| 10 | - | |
| 11 | - | |
| 14 | +class class_team_shortcodes { | |
| 15 | + | |
| 16 | + | |
| 12 | 17 | public function __construct() |
| 13 | 18 | { |
| 19 | + | |
| 20 | + add_shortcode( 'team', array( $this, 'team_display' ) ); | |
| 21 | + //add_shortcode( 'team_single', array( $this, 'team_single_display' ) ); | |
| 14 | 22 | |
| 15 | - add_shortcode('team', array($this, 'team_showcase_display')); | |
| 16 | - add_shortcode('team_pickplugins', array($this, 'team_showcase_display')); // To avoid Conflict | |
| 17 | - add_shortcode('team_showcase', array($this, 'team_showcase_display')); | |
| 23 | + | |
| 18 | 24 | } |
| 19 | - public function team_showcase_display($atts, $content = null) | |
| 20 | - { | |
| 21 | - $atts = shortcode_atts( | |
| 22 | - array( | |
| 23 | - 'id' => "", | |
| 25 | + | |
| 26 | + public function team_display($atts, $content = null ) { | |
| 27 | + $atts = shortcode_atts( | |
| 28 | + array( | |
| 29 | + 'id' => "", | |
| 30 | + | |
| 31 | + ), $atts); | |
| 32 | + | |
| 33 | + $html = ''; | |
| 34 | + $post_id = $atts['id']; | |
| 35 | + | |
| 36 | + $team_themes = get_post_meta( $post_id, 'team_themes', true ); | |
| 37 | + | |
| 38 | + $class_team_functions = new class_team_functions(); | |
| 39 | + $team_themes_dir = $class_team_functions->team_themes_dir(); | |
| 40 | + $team_themes_url = $class_team_functions->team_themes_url(); | |
| 24 | 41 | |
| 25 | - ), | |
| 26 | - $atts | |
| 27 | - ); | |
| 42 | + | |
| 28 | 43 | |
| 29 | - $html = ''; | |
| 30 | - $team_id = isset($atts['id']) ? $atts['id'] : ''; | |
| 44 | + include $team_themes_dir[$team_themes].'/index.php'; | |
| 45 | + | |
| 46 | + include team_plugin_dir.'/templates/team-grid-custom-css.php'; | |
| 47 | + | |
| 48 | + $html.= '<link type="text/css" media="all" rel="stylesheet" href="'.$team_themes_url[$team_themes].'/style.min.css" >'; | |
| 49 | + | |
| 50 | + return $html; | |
| 51 | + | |
| 52 | + | |
| 53 | + } | |
| 31 | 54 | |
| 32 | - $args = array('team_id' => $team_id); | |
| 33 | 55 | |
| 34 | - ob_start(); | |
| 35 | -?> | |
| 36 | - <div id="team-<?php echo esc_attr($team_id); ?>" class="team-container"> | |
| 37 | - <?php | |
| 38 | - do_action('team_showcase_main', $args); | |
| 39 | - ?> | |
| 40 | - </div> | |
| 41 | -<?php | |
| 42 | - return ob_get_clean(); | |
| 43 | - } | |
| 56 | + | |
| 57 | + public function team_single_display($atts, $content = null ) { | |
| 58 | + $atts = shortcode_atts( | |
| 59 | + array( | |
| 60 | + 'themes' => "flat", | |
| 61 | + | |
| 62 | + ), $atts); | |
| 63 | + | |
| 64 | + $html = ''; | |
| 65 | + $themes = $atts['themes']; | |
| 66 | + | |
| 67 | + | |
| 68 | + $class_team_functions = new class_team_functions(); | |
| 69 | + $team_single_themes_dir = $class_team_functions->team_single_themes_dir(); | |
| 70 | + $team_single_themes_url = $class_team_functions->team_single_themes_url(); | |
| 71 | + | |
| 72 | + echo '<link type="text/css" media="all" rel="stylesheet" href="'.$team_single_themes_url[$themes].'/style.min.css" >'; | |
| 73 | + | |
| 74 | + include $team_single_themes_dir[$themes].'/index.php'; | |
| 75 | + | |
| 76 | + return $html; | |
| 77 | + | |
| 78 | + | |
| 79 | + } | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 44 | 87 | } |
| 45 | 88 | |
| 46 | 89 | |
| 47 | 90 | new class_team_shortcodes(); |
| 91 | + | |