| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* @Author ParaTheme |
| 5 |
* @Folder Team/Includes |
| 6 |
* @version 3.0.5 |
| 7 |
|
| 8 |
* Copyright: 2015 ParaTheme |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined('ABSPATH')) exit; // if direct access |
| 12 |
|
| 13 |
|
| 14 |
class class_team_shortcodes { |
| 15 |
|
| 16 |
|
| 17 |
public function __construct() |
| 18 |
{ |
| 19 |
|
| 20 |
add_shortcode( 'team', array( $this, 'team_display' ) ); |
| 21 |
add_shortcode( 'team_single', array( $this, 'team_single_display' ) ); |
| 22 |
|
| 23 |
|
| 24 |
} |
| 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(); |
| 41 |
|
| 42 |
|
| 43 |
|
| 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 |
} |
| 54 |
|
| 55 |
|
| 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 |
|
| 87 |
} |
| 88 |
|
| 89 |
|
| 90 |
new class_team_shortcodes(); |
| 91 |
|
| 92 |
|