Team Members - Version 5.1.0

Version Description

  • Fixed photo styling issue
  • Better handling of rounded photos
Download this release

Release Info

Developer spwebguy
Plugin Icon 128x128 Team Members
Version 5.1.0
Comparing to
See all releases

Code changes from version 5.0.10 to 5.1.0

inc/css/tmm_style.css CHANGED
@@ -71,9 +71,9 @@
71
  -webkit-box-shadow: 2px 0px 1px 0px rgba(0,0,0,0.05);
72
  -moz-box-shadow: 2px 0px 1px 0px rgba(0,0,0,0.05);
73
  box-shadow: 2px 0px 1px 0px rgba(0,0,0,0.05);
74
- border-radius:60px !important;
75
  margin-top:-30%;
76
- border:6px solid #eeeeee;}
77
 
78
  .tmm_1_columns .tmm_member .tmm_photo {
79
  width:35%; padding-bottom:35%; margin-top: -18%; }
71
  -webkit-box-shadow: 2px 0px 1px 0px rgba(0,0,0,0.05);
72
  -moz-box-shadow: 2px 0px 1px 0px rgba(0,0,0,0.05);
73
  box-shadow: 2px 0px 1px 0px rgba(0,0,0,0.05);
74
+ border-radius: 34% !important;
75
  margin-top:-30%;
76
+ border:6px solid #eeeeee; }
77
 
78
  .tmm_1_columns .tmm_member .tmm_photo {
79
  width:35%; padding-bottom:35%; margin-top: -18%; }
inc/css/tmm_style.min.css CHANGED
@@ -4,4 +4,4 @@
4
  * Team Members Front CSS (minified)
5
  */
6
 
7
- .tmm .tmm_wrap{width:100%;margin-bottom:30px;text-align:center}.tmm .clearer{clear:both}.tmm .tmm_container{display:inline}.tmm .tmm_container:last-child{display:block;text-align:center!important}.tmm .tmm_container:last-child .tmm_member{float:none!important}.tmm .tmm_columns_containers_desktop{display:block;clear:both}.tmm .tmm_member{vertical-align:top;display:inline-block;margin-top:70px;margin-bottom:30px;height:auto;float:left;position:relative;text-align:center;-webkit-box-shadow:3px 0 5px 0 rgba(0,0,0,.04);-moz-box-shadow:3px 0 5px 0 rgba(0,0,0,.04);box-shadow:3px 0 5px 0 rgba(0,0,0,.04);border-top:5px solid lightgrey;border-left:solid 1px #eee;border-right:solid 1px #eee;border-bottom:5px solid whitesmoke;background:white;box-sizing:border-box}.tmm .tmm_three_entries{clear:both}.tmm .tmm_2_columns .tmm_member{margin-right:4%;margin-left:4%}.tmm .tmm_3_columns .tmm_member{margin-right:2%;margin-left:2%}.tmm .tmm_4_columns .tmm_member{margin-right:1%;margin-left:1%}.tmm .tmm_2_columns .tmm_member{width:42%}.tmm .tmm_3_columns .tmm_member{width:29%}.tmm .tmm_4_columns .tmm_member{width:23%}.tmm .tmm_1_columns .tmm_member{width:96%;margin-right:2%;margin-left:2%}.tmm .tmm_5_columns .tmm_member{width:18%;margin-right:1%;margin-left:1%}.tmm .tmm_member .tmm_photo{margin-left:auto;margin-right:auto;background-size:cover!important;background-position:center center!important;width:60%;padding-bottom:60%;border:none;-webkit-box-shadow:2px 0 1px 0 rgba(0,0,0,.05);-moz-box-shadow:2px 0 1px 0 rgba(0,0,0,.05);box-shadow:2px 0 1px 0 rgba(0,0,0,.05);border-radius:60px!important;margin-top:-80px;border:6px solid #eee}.tmm .tmm_member .tmm_textblock .tmm_scblock{padding-top:10px}.tmm .tmm_member .tmm_textblock{padding:10px 12px}.tmm .tmm_member .tmm_textblock .tmm_sociallink{clear:both;margin-bottom:20px;border:none;box-shadow:0 0 0}.tmm .tmm_member .tmm_textblock .tmm_sociallink img{display:inline-block;border:none;width:24px;height:24px;box-shadow:0 0 0 0;margin:10px 4px}.tmm .tmm_5_columns .tmm_member .tmm_textblock .tmm_sociallink img{width:19px;height:19px;margin:6px 2px}.tmm .tmm_4_columns .tmm_member .tmm_textblock .tmm_sociallink img{width:21px;height:21px;margin:6px 3px}.tmm .tmm_member .tmm_textblock .tmm_sociallink img:hover{opacity:.8}.tmm .tmm_fname{display:inline}.tmm .tmm_lname{display:inline}.tmm .tmm_names span,.tmm .tmm_names span.tmm_fname,.tmm .tmm_names span.tmm_lname,.tmm .tmm_names{color:#222}.tmm .tmm_desc,.tmm .tmm_desc span,.tmm .tmm_desc p{color:#555;word-break:break-word}.tmm .tmm_job,.tmm .tmm_job p{color:#888}.tmm .tmm_plugin_f .tmm_names{font-size:20px;font-weight:400;line-height:24px;margin-bottom:8px;margin-top:10px}.tmm .tmm_plugin_f .tmm_job{font-size:16px;font-weight:400}.tmm .tmm_plugin_f .tmm_desc{padding:0;margin-top:19px;margin-bottom:10px;font-weight:400;font-size:14px;line-height:23px}.tmm .tmm_theme_f .tmm_names{font-size:1.1em;font-weight:400;margin-bottom:8px;margin-top:10px}.tmm .tmm_theme_f .tmm_job{font-size:1em;font-weight:400}.tmm .tmm_theme_f .tmm_desc{font-size:.9em;line-height:165%;padding:0;font-weight:400;margin-top:19px;margin-bottom:10px}@media only screen and (max-width:64.063em){.tmm .tmm_columns_containers_desktop{display:none;clear:none}.tmm_two_containers_tablet{display:block;clear:both}.tmm .tmm_2_columns .tmm_member,.tmm .tmm_3_columns .tmm_member,.tmm .tmm_4_columns .tmm_member,.tmm .tmm_5_columns .tmm_member{width:40%;margin-left:5%;margin-right:5%;margin-top:70px;margin-bottom:30px}}@media only screen and (max-width:40em){.tmm .tmm_columns_containers_desktop{display:none;clear:none}.tmm .tmm_member{width:96%;margin:0 2%;margin-top:70px;margin-bottom:30px}.tmm .tmm_2_columns .tmm_member,.tmm .tmm_3_columns .tmm_member,.tmm .tmm_4_columns .tmm_member,.tmm .tmm_5_columns .tmm_member{width:96%;margin:0 2%;margin-top:90px;margin-bottom:10px}.tmm .tmm_plugin_f .tmm_desc{padding:0 10px;font-size:16px;line-height:27px}}.tmm_plugin_f,.tmm_plugin_f .tmm_names span,.tmm_plugin_f .tmm_job,.tmm_plugin_f .tmm_desc,.tmm_plugin_f .tmm_desc a,.tmm_plugin_f .tmm_desc span,.tmm_plugin_f .tmm_desc p,.tmm_plugin_f .tmm_desc h1,.tmm_plugin_f .tmm_desc h2,.tmm_plugin_f .tmm_desc h3,.tmm_plugin_f .tmm_desc h4,.tmm_plugin_f .tmm_desc h5,.tmm_plugin_f .tmm_desc h6,.tmm_plugin_f .tmm_desc ul li,.tmm_plugin_f .tmm_desc ol li{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}
4
  * Team Members Front CSS (minified)
5
  */
6
 
7
+ .tmm .tmm_wrap{width:100%;margin-bottom:30px;text-align:center}.tmm .clearer{clear:both}.tmm .tmm_container{display:inline}.tmm .tmm_container:last-child{display:block;text-align:center!important}.tmm .tmm_container:last-child .tmm_member{float:none!important}.tmm .tmm_columns_containers_desktop{display:block;clear:both}.tmm .tmm_member{vertical-align:top;display:inline-block;margin-top:25px;margin-bottom:25px;height:auto;float:left;position:relative;text-align:center;-webkit-box-shadow:3px 0 5px 0 rgba(0,0,0,.04);-moz-box-shadow:3px 0 5px 0 rgba(0,0,0,.04);box-shadow:3px 0 5px 0 rgba(0,0,0,.04);border-top:5px solid #d3d3d3;border-left:solid 1px #eee;border-right:solid 1px #eee;border-bottom:5px solid #f5f5f5;background:#fff;box-sizing:border-box}.tmm .tmm_1_columns .tmm_member{width:96%;margin-right:2%;margin-left:2%;margin-top:140px;margin-bottom:25px}.tmm .tmm_2_columns .tmm_member{width:42%;margin-right:4%;margin-left:4%;margin-top:120px;margin-bottom:25px}.tmm .tmm_3_columns .tmm_member{width:29%;margin-right:2.16%;margin-left:2.16%;margin-top:100px;margin-bottom:25px}.tmm .tmm_4_columns .tmm_member{width:23%;margin-right:1%;margin-left:1%;margin-top:80px;margin-bottom:20px}.tmm .tmm_5_columns .tmm_member{width:18%;margin-right:1%;margin-left:1%;margin-top:50px;margin-bottom:35px}.tmm .tmm_three_entries{clear:both}.tmm .tmm_member .tmm_photo{margin-left:auto;margin-right:auto;background-size:cover!important;background-position:center center!important;width:60%;padding-bottom:60%;border:none;-webkit-box-shadow:2px 0 1px 0 rgba(0,0,0,.05);-moz-box-shadow:2px 0 1px 0 rgba(0,0,0,.05);box-shadow:2px 0 1px 0 rgba(0,0,0,.05);border-radius:34%!important;margin-top:-30%;border:6px solid #eee}.tmm_1_columns .tmm_member .tmm_photo{width:35%;padding-bottom:35%;margin-top:-18%}.tmm_2_columns .tmm_member .tmm_photo{width:50%;padding-bottom:50%;margin-top:-25%}.tmm .tmm_member .tmm_textblock .tmm_scblock{padding-top:10px}.tmm .tmm_member .tmm_textblock{padding:10px 12px}.tmm .tmm_member .tmm_textblock .tmm_sociallink{clear:both;margin-bottom:20px;border:none;box-shadow:0 0 0}.tmm .tmm_member .tmm_textblock .tmm_sociallink img{display:inline-block;border:none;width:24px;height:24px;box-shadow:0 0;margin:10px 4px}.tmm .tmm_5_columns .tmm_member .tmm_textblock .tmm_sociallink img{width:19px;height:19px;margin:6px 2px}.tmm .tmm_4_columns .tmm_member .tmm_textblock .tmm_sociallink img{width:21px;height:21px;margin:6px 3px}.tmm .tmm_member .tmm_textblock .tmm_sociallink img:hover{opacity:.8}.tmm .tmm_fname{display:inline}.tmm .tmm_lname{display:inline}.tmm .tmm_names,.tmm .tmm_names span,.tmm .tmm_names span.tmm_fname,.tmm .tmm_names span.tmm_lname{color:#222}.tmm .tmm_desc,.tmm .tmm_desc p,.tmm .tmm_desc span{color:#555;word-break:break-word}.tmm .tmm_job,.tmm .tmm_job p{color:#888}.tmm .tmm_plugin_f .tmm_names{font-size:20px;font-weight:400;line-height:24px;margin-bottom:8px;margin-top:10px}.tmm .tmm_plugin_f .tmm_job{font-size:16px;font-weight:400}.tmm .tmm_plugin_f .tmm_desc{padding:0;margin-top:19px;margin-bottom:10px;font-weight:400;font-size:14px;line-height:23px}.tmm .tmm_theme_f .tmm_names{font-size:1.1em;font-weight:400;margin-bottom:8px;margin-top:10px}.tmm .tmm_theme_f .tmm_job{font-size:1em;font-weight:400}.tmm .tmm_theme_f .tmm_desc{font-size:.9em;line-height:165%;padding:0;font-weight:400;margin-top:19px;margin-bottom:10px}@media only screen and (max-width:64.063em){.tmm .tmm_columns_containers_desktop{display:none;clear:none}.tmm_two_containers_tablet{display:block;clear:both}.tmm .tmm_2_columns .tmm_member,.tmm .tmm_3_columns .tmm_member,.tmm .tmm_4_columns .tmm_member,.tmm .tmm_5_columns .tmm_member,.tmm .tmm_member{width:40%;margin-left:5%;margin-right:5%;margin-top:80px;margin-bottom:25px}.tmm .tmm_1_columns .tmm_member{margin-top:100px;margin-bottom:15px}.tmm .tmm_2_columns .tmm_member .tmm_photo,.tmm .tmm_3_columns .tmm_member .tmm_photo,.tmm .tmm_4_columns .tmm_member .tmm_photo,.tmm .tmm_5_columns .tmm_member .tmm_photo,.tmm .tmm_member .tmm_photo{width:50%;padding-bottom:50%;margin-top:-25%}}@media only screen and (max-width:40em){.tmm .tmm_columns_containers_desktop{display:none;clear:none}.tmm .tmm_1_columns .tmm_member,.tmm .tmm_2_columns .tmm_member,.tmm .tmm_3_columns .tmm_member,.tmm .tmm_4_columns .tmm_member,.tmm .tmm_5_columns .tmm_member,.tmm .tmm_member{width:96%;margin:0 2%;margin-top:110px;margin-bottom:25px}.tmm .tmm_1_columns .tmm_member .tmm_photo,.tmm .tmm_2_columns .tmm_member .tmm_photo,.tmm .tmm_3_columns .tmm_member .tmm_photo,.tmm .tmm_4_columns .tmm_member .tmm_photo,.tmm .tmm_5_columns .tmm_member .tmm_photo,.tmm .tmm_member .tmm_photo{width:45%;padding-bottom:45%;margin-top:-24%}.tmm .tmm_plugin_f .tmm_desc{padding:0 10px;font-size:16px;line-height:27px}}.tmm_plugin_f,.tmm_plugin_f .tmm_desc,.tmm_plugin_f .tmm_desc a,.tmm_plugin_f .tmm_desc h1,.tmm_plugin_f .tmm_desc h2,.tmm_plugin_f .tmm_desc h3,.tmm_plugin_f .tmm_desc h4,.tmm_plugin_f .tmm_desc h5,.tmm_plugin_f .tmm_desc h6,.tmm_plugin_f .tmm_desc ol li,.tmm_plugin_f .tmm_desc p,.tmm_plugin_f .tmm_desc span,.tmm_plugin_f .tmm_desc ul li,.tmm_plugin_f .tmm_job,.tmm_plugin_f .tmm_names span{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}
inc/tmm-admin-scripts.php CHANGED
@@ -29,6 +29,4 @@ function add_admin_tmm_style() {
29
 
30
  }
31
 
32
- }
33
-
34
- ?>
29
 
30
  }
31
 
32
+ }
 
 
inc/tmm-front-scripts.php CHANGED
@@ -7,6 +7,4 @@ function add_tmm_scripts() {
7
  /* Front end CSS. */
8
  wp_enqueue_style( 'tmm', plugins_url('css/tmm_style.css', __FILE__));
9
 
10
- }
11
-
12
- ?>
7
  /* Front end CSS. */
8
  wp_enqueue_style( 'tmm', plugins_url('css/tmm_style.css', __FILE__));
9
 
10
+ }
 
 
inc/tmm-metaboxes-help.php CHANGED
@@ -1,44 +1,52 @@
1
- <?php
2
 
3
  /* Hooks the metabox. */
4
  add_action('admin_init', 'dmb_tmm_add_help', 1);
5
- function dmb_tmm_add_help() {
6
- add_meta_box(
7
- 'tmm_help',
8
- 'Shortcode',
 
9
  'dmb_tmm_help_display', // Below
10
- 'tmm',
11
- 'side',
12
  'high'
13
  );
14
  }
15
 
16
 
17
  /* Displays the metabox. */
18
- function dmb_tmm_help_display() { ?>
 
19
 
20
- <div class="dmb_side_block">
21
- <p>
22
- <?php
23
- global $post;
24
- $slug = '';
25
- $slug = $post->post_name;
26
- $shortcode = '<span style="display:inline-block;border:solid 2px #999999; background:white; padding:0 8px 2px; font-size:14px; line-height:25px; vertical-align:middle;">[tmm name="'.$slug.'"]</span>';
27
- $shortcode_unpublished = "<span style='display:inline-block;color:#e17055'>" . /* translators: Leave HTML tags */ __("<strong>Publish</strong> your team before you can see you shortcode here!", TMM_TXTDM ) . "</span>";
28
- echo ($slug != '') ? $shortcode : $shortcode_unpublished;
29
- ?>
30
- </p>
31
- <p>
32
- <?php /* translators: Leave HTML tags */ _e('To display your team on your site, copy-paste the <strong>[Shortcode]</strong> above in your post/page.', TMM_TXTDM ) ?>
33
- </p>
34
- </div>
35
 
36
- <div class="dmb_side_block">
37
- <div class="dmb_help_title">
38
- Get support
39
- </div>
40
- <a target="_blank" href="https://wpdarko.com/support/submit-a-request/">Submit a ticket</a><br/>
41
- <a target="_blank" href="https://wpdarko.com/support">View documentation</a>
42
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  <?php } ?>
1
+ <?php
2
 
3
  /* Hooks the metabox. */
4
  add_action('admin_init', 'dmb_tmm_add_help', 1);
5
+ function dmb_tmm_add_help()
6
+ {
7
+ add_meta_box(
8
+ 'tmm_help',
9
+ 'Shortcode',
10
  'dmb_tmm_help_display', // Below
11
+ 'tmm',
12
+ 'side',
13
  'high'
14
  );
15
  }
16
 
17
 
18
  /* Displays the metabox. */
19
+ function dmb_tmm_help_display()
20
+ { ?>
21
 
22
+ <div class="dmb_side_block">
23
+ <p>
24
+ <?php
25
+ global $post;
26
+ $slug = '';
27
+ $slug = $post->post_name; ?>
 
 
 
 
 
 
 
 
 
28
 
29
+ <?php if ($slug != '') { ?>
30
+ <span
31
+ style="display:inline-block;border:solid 2px lightgray; background:white; padding:0 8px; font-size:13px; line-height:25px; vertical-align:middle;">[tmm
32
+ name="<?php echo esc_attr($slug); ?>"]</span>
33
+ <?php } else { ?>
34
+ <span style='display:inline-block;color:#849d3a'>
35
+ <?php /* translators: Leave HTML tags */ esc_attr_e("Publish your team before you can see your shortcode.", TMM_TXTDM); ?>
36
+ </span>
37
+ <?php } ?>
38
+ </p>
39
+ <p>
40
+ <?php /* translators: Leave HTML tags */ esc_attr_e('To display your team on your site, copy-paste the shortcode above in your post/page.', TMM_TXTDM) ?>
41
+ </p>
42
+ </div>
43
+
44
+ <div class="dmb_side_block">
45
+ <div class="dmb_help_title">
46
+ Get support
47
+ </div>
48
+ <a target="_blank" href="https://wpdarko.com/support/submit-a-request/">Submit a ticket</a><br />
49
+ <a target="_blank" href="https://wpdarko.com/support">View documentation</a>
50
+ </div>
51
 
52
  <?php } ?>
inc/tmm-metaboxes-members.php CHANGED
@@ -1,509 +1,576 @@
1
  <?php
2
 
3
  /* Defines highlight select options. */
4
- function dmb_tmm_social_links_options() {
5
- $options = array (
6
- __('-', TMM_TXTDM ) => 'nada',
7
- __('Twitter', TMM_TXTDM ) => 'twitter',
8
- __('LinkedIn', TMM_TXTDM ) => 'linkedin',
9
- __('YouTube', TMM_TXTDM ) => 'youtube',
10
- __('Google+', TMM_TXTDM ) => 'googleplus',
11
- __('Facebook', TMM_TXTDM ) => 'facebook',
12
- __('Pinterest', TMM_TXTDM ) => 'pinterest',
13
- __('VK', TMM_TXTDM ) => 'vk',
14
- __('Instagram', TMM_TXTDM ) => 'instagram',
15
- __('Tumblr', TMM_TXTDM ) => 'tumblr',
16
- __('Research Gate', TMM_TXTDM ) => 'researchgate',
17
- __('Email', TMM_TXTDM ) => 'email',
18
- __('Website', TMM_TXTDM ) => 'website',
19
- __('Phone', TMM_TXTDM ) => 'phone',
20
- __('Other links', TMM_TXTDM ) => 'customlink'
21
- );
 
22
  return $options;
23
  }
24
 
25
-
26
  /* Hooks the metabox. */
27
  add_action('admin_init', 'dmb_tmm_add_team', 1);
28
- function dmb_tmm_add_team() {
29
- add_meta_box(
30
- 'tmm',
31
- __('Manage your team', TMM_TXTDM ),
 
32
  'dmb_tmm_team_display', // Below
33
- 'tmm',
34
- 'normal',
35
  'high'
36
  );
37
  }
38
 
39
-
40
  /* Displays the metabox. */
41
- function dmb_tmm_team_display() {
 
42
 
43
  global $post;
44
-
45
  /* Gets team data. */
46
- $team = get_post_meta( $post->ID, '_tmm_head', true );
47
-
48
  $fields_to_process = array(
49
- '_tmm_firstname',
50
- '_tmm_lastname',
51
- '_tmm_job',
52
- '_tmm_desc',
53
- '_tmm_sc_type1', '_tmm_sc_title1', '_tmm_sc_url1',
54
- '_tmm_sc_type2', '_tmm_sc_title2', '_tmm_sc_url2',
55
- '_tmm_sc_type3', '_tmm_sc_title3', '_tmm_sc_url3',
56
- '_tmm_photo',
57
- '_tmm_photo_url'
58
  );
59
 
60
  /* Retrieves select options. */
61
  $social_links_options = dmb_tmm_social_links_options();
62
 
63
- wp_nonce_field( 'dmb_tmm_meta_box_nonce', 'dmb_tmm_meta_box_nonce' ); ?>
64
-
65
- <div id="dmb_preview_team">
66
- <!-- Closes preview button. -->
67
- <a class="dmb_button dmb_button_huge dmb_button_gold dmb_preview_team_close" href="#">
68
- <?php _e('Close preview', TMM_TXTDM ) ?>
69
- </a>
70
- </div>
71
-
72
- <?php if( !class_exists('acf') ) { ?>
73
-
74
- <div id="dmb_unique_editor">
75
- <?php wp_editor( '', 'dmb_editor', array('editor_height' => '300px' ) ); ?>
76
- <br/>
77
- <a class="dmb_button dmb_button_huge dmb_button_blue dmb_ue_update" href="#">
78
- <?php _e('Update biography', TMM_TXTDM ) ?>
79
- </a>
80
- <a class="dmb_button dmb_button_huge dmb_ue_cancel" href="#">
81
- <?php _e('Cancel', TMM_TXTDM ) ?>
82
- </a>
83
- </div>
84
-
85
- <?php } ?>
86
-
87
- <!-- Toolbar for member metabox -->
88
- <div class="dmb_toolbar">
89
- <a class="dmb_button dmb_button_large dmb_expand_rows" href="#"><span class="dashicons dashicons-editor-expand"></span> <?php _e('Expand all', TMM_TXTDM ) ?></a>
90
- <a class="dmb_button dmb_button_large dmb_collapse_rows" href="#"><span class="dashicons dashicons-editor-contract"></span> <?php _e('Collapse all', TMM_TXTDM ) ?></a>
91
- <a class="dmb_show_preview_team dmb_button dmb_button_huge dmb_button_gold"><?php _e('Instant preview', TMM_TXTDM ) ?></a>
92
- <div class="dmb_clearfix"></div>
93
- </div>
94
-
95
- <?php if ( $team ) {
 
 
 
96
 
97
  /* Loops through rows. */
98
- foreach ( $team as $team_member ) {
99
 
100
  /* Retrieves each field for current member. */
101
  $member = array();
102
- foreach ( $fields_to_process as $field) {
103
  switch ($field) {
104
  default:
105
- $member[$field] = ( isset($team_member[$field]) ) ? esc_attr($team_member[$field]) : '';
106
  break;
107
  }
108
  } ?>
109
 
110
- <!-- START member -->
111
- <div class="dmb_main">
112
-
113
- <textarea class="dmb_data_dump" name="tmm_data_dumps[]"></textarea>
114
-
115
- <!-- Member handle bar -->
116
- <div class="dmb_handle">
117
- <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_up" href="#" title="Move up"><span class="dashicons dashicons-arrow-up-alt2"></span></a>
118
- <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_down" href="#" title="Move down"><span class="dashicons dashicons-arrow-down-alt2"></span></a>
119
- <div class="dmb_handle_title"></div>
120
- <a class="dmb_button dmb_button_large dmb_button_compact dmb_remove_row_btn" href="#" title="Remove"><span class="dashicons dashicons-trash"></span></a>
121
- <a class="dmb_button dmb_button_large dmb_clone_row" href="#" title="Clone"><span class="dashicons dashicons-admin-page"></span><?php _e('Clone', TMM_TXTDM ); ?></a>
122
- <div class="dmb_clearfix"></div>
123
- </div>
124
-
125
- <!-- START inner -->
126
- <div class="dmb_inner">
 
 
 
 
 
 
 
 
127
 
128
- <div class="dmb_section_title">
129
- <?php _e('Member details', TMM_TXTDM ) ?>
130
- </div>
 
 
 
 
 
131
 
132
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
133
- <div class="dmb_field_title">
134
- <?php _e('First name', TMM_TXTDM ) ?>
135
- </div>
136
- <input class="dmb_field dmb_highlight_field dmb_firstname_of_member" type="text" value="<?php echo $member['_tmm_firstname']; ?>" placeholder="<?php _e('e.g. John', TMM_TXTDM ) ?>" />
137
- </div>
 
 
138
 
139
- <div class="dmb_grid dmb_grid_33 ">
140
- <div class="dmb_field_title">
141
- <?php _e('Lastname', TMM_TXTDM ) ?>
142
- </div>
143
- <input class="dmb_field dmb_lastname_of_member" type="text" value="<?php echo $member['_tmm_lastname']; ?>" placeholder="<?php _e('e.g. Doe', TMM_TXTDM ) ?>" />
144
- </div>
 
 
145
 
146
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
147
- <div class="dmb_field_title">
148
- <?php _e('Job/role', TMM_TXTDM ) ?>
149
- </div>
150
- <input class="dmb_field dmb_job_of_member" type="text" value="<?php echo $member['_tmm_job']; ?>" placeholder="<?php _e('e.g. Project manager', TMM_TXTDM ) ?>" />
151
- </div>
152
 
153
- <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
154
-
155
- <?php if( !class_exists('acf') ) { ?>
156
 
157
- <div class="dmb_field_title">
158
- <?php _e('Description/biography', TMM_TXTDM ) ?>
159
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Edit your member\'s biography by clicking the button below. Once updated, it will show up here.', TMM_TXTDM ) ?>">[?]</a>
160
- </div>
 
161
 
162
- <div class="dmb_field dmb_description_of_member">
163
- <?php echo $member["_tmm_desc"]; ?>
164
- </div>
165
 
166
- <?php } else { ?>
167
 
168
- <div class="dmb_field_title">
169
- <?php _e('Description/biography', TMM_TXTDM ) ?>
170
- </div>
171
 
172
- <div class="dmb_field dmb_description_of_member_fb" style="display:none !important;"><?php echo $member["_tmm_desc"]; ?></div>
173
- <textarea id="acf-fallback-bio"><?php echo $member["_tmm_desc"]; ?></textarea>
 
174
 
175
- <?php } ?>
176
 
177
- <div class="dmb_clearfix"></div>
178
 
179
- <?php if( !class_exists('acf') ) { ?>
180
- <div class="dmb_edit_description_of_member dmb_button dmb_button_large dmb_button_blue">
181
- <?php _e('Edit biography', TMM_TXTDM ) ?>
182
- </div>
183
- <?php } ?>
184
 
185
- </div>
186
 
187
- <div class="dmb_clearfix"></div>
188
 
189
- <div class="dmb_section_title">
190
- <?php _e('Social links', TMM_TXTDM ) ?>
191
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('These links will appear below your members\' biography.', TMM_TXTDM ) ?>">[?]</a>
192
- </div>
 
193
 
194
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
195
  <div class="dmb_field_title">
196
- <?php _e('Link type', TMM_TXTDM ) ?>
197
  </div>
198
  <select class="dmb_scl_type_select dmb_scl_type1_of_member">
199
- <?php foreach ( $social_links_options as $label => $value ) { ?>
200
- <option value="<?php echo $value; ?>"<?php selected( $member['_tmm_sc_type1'], $value ); ?>><?php echo $label; ?></option>
201
- <?php } ?>
 
 
202
  </select>
203
- </div>
204
-
205
- <div class="dmb_grid dmb_grid_33 ">
206
- <div class="dmb_field_title">
207
- <?php _e('Title attribute', TMM_TXTDM ) ?>
208
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Optional. This is the HTML <a> tag\'s title attribute.', TMM_TXTDM ) ?>">[?]</a>
209
- </div>
210
- <input class="dmb_field dmb_scl_title1_of_member" type="text" value="<?php echo $member['_tmm_sc_title1']; ?>" placeholder="<?php _e('e.g. Faceook page', TMM_TXTDM ) ?>" />
211
- </div>
212
-
213
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
214
- <div class="dmb_field_title">
215
- <?php _e('Link URL', TMM_TXTDM ) ?>
216
- </div>
217
- <input class="dmb_field dmb_scl_url1_of_member" type="text" value="<?php echo $member['_tmm_sc_url1']; ?>" placeholder="<?php _e('e.g. http://fb.com/member-profile', TMM_TXTDM ) ?>" />
218
- </div>
219
-
220
- <div class="dmb_clearfix" style="margin-bottom:6px"></div>
221
-
222
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
 
 
 
 
 
223
  <select class="dmb_scl_type_select dmb_scl_type2_of_member">
224
- <?php foreach ( $social_links_options as $label => $value ) { ?>
225
- <option value="<?php echo $value; ?>"<?php selected( $member['_tmm_sc_type2'], $value ); ?>><?php echo $label; ?></option>
226
- <?php } ?>
 
 
227
  </select>
228
- </div>
229
 
230
- <div class="dmb_grid dmb_grid_33 ">
231
- <input class="dmb_field dmb_scl_title2_of_member" type="text" value="<?php echo $member['_tmm_sc_title2']; ?>" placeholder="<?php _e('e.g. Twitter page', TMM_TXTDM ) ?>" />
232
- </div>
 
 
233
 
234
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
235
- <input class="dmb_field dmb_scl_url2_of_member" type="text" value="<?php echo $member['_tmm_sc_url2']; ?>" placeholder="<?php _e('e.g. http://tw.com/member-profile', TMM_TXTDM ) ?>" />
236
- </div>
 
 
237
 
238
- <div class="dmb_clearfix" style="margin-bottom:6px"></div>
239
 
240
- <div class="dmb_grid dmb_grid_33 dmb_grid_first dmb_grid_first">
241
  <select class="dmb_scl_type_select dmb_scl_type3_of_member">
242
- <?php foreach ( $social_links_options as $label => $value ) { ?>
243
- <option value="<?php echo $value; ?>"<?php selected( $member['_tmm_sc_type3'], $value ); ?>><?php echo $label; ?></option>
244
- <?php } ?>
 
 
245
  </select>
246
- </div>
247
-
248
- <div class="dmb_grid dmb_grid_33 ">
249
- <input class="dmb_field dmb_scl_title3_of_member" type="text" value="<?php echo $member['_tmm_sc_title3']; ?>" placeholder="<?php _e('e.g. Google+ page', TMM_TXTDM ) ?>" />
250
- </div>
251
-
252
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
253
- <input class="dmb_field dmb_scl_url3_of_member" type="text" value="<?php echo $member['_tmm_sc_url3']; ?>" placeholder="<?php _e('e.g. http://gp.com/member-profile', TMM_TXTDM ) ?>" />
254
- </div>
255
-
256
- <div class="dmb_clearfix"></div>
257
-
258
- <div class="dmb_tip">
259
- <span class="dashicons dashicons-yes"></span> <?php _e('Links with the email type open your visitors\' mail client.', TMM_TXTDM ); ?> <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Your member\'s email address must be entered in the Link URL field. Title attribute can be left blank.', TMM_TXTDM ) ?>">[?]</a>
260
- <br/><span class="dashicons dashicons-yes"></span> <?php _e('Links with the <strong>phone</strong> type open your visitors\' default phone app.', TMM_TXTDM ) ?> <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Your member\'s phone number must be entered in the Link URL field (e.g. tel:+11234567890). Title attribute can be left blank.', TMM_TXTDM ) ?>">[?]</a>
261
- </div>
262
-
263
- <div class="dmb_clearfix"></div>
264
-
265
- <div class="dmb_section_title">
266
- <?php _e('Photo', TMM_TXTDM ) ?>
267
- </div>
268
-
269
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
270
-
271
- <div class="dmb_field_title">
272
- <?php _e('Member\'s photo', TMM_TXTDM ) ?>
273
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('We recommend that all photos are the same sizes.', TMM_TXTDM ) ?>">[?]</a>
274
- </div>
275
-
276
- <div class="dmb_photo_of_member">
277
- <div class="dmb_field_title dmb_img_data_url" data-img="<?php echo $member['_tmm_photo']; ?>">
278
- </div>
279
- <div class="dmb_upload_img_btn dmb_button dmb_button_large dmb_button_blue">
280
- <?php _e('Upload photo', TMM_TXTDM ) ?>
281
- </div>
282
- </div>
283
-
284
- </div>
285
-
286
- <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last" style="margin-top:7px;">
287
- <div class="dmb_field_title">
288
- <?php _e('Photo link', TMM_TXTDM ) ?>
289
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Your visitors will be redirected to this link if they click the member\'s photo.', TMM_TXTDM ) ?>">[?]</a>
290
- </div>
291
- <input class="dmb_field dmb_photo_url_of_member" type="text" value="<?php echo $member['_tmm_photo_url']; ?>" placeholder="<?php _e('e.g. http://your-site.com/full-member-page/', TMM_TXTDM ) ?>" />
292
- </div>
293
-
294
- <div class="dmb_clearfix" style="margin-bottom:6px"></div>
295
-
296
- <!-- END inner -->
297
- </div>
298
-
299
- <!-- END row -->
300
- </div>
301
-
302
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
  } ?>
305
 
306
- <!-- START empty member -->
307
- <div class="dmb_main dmb_empty_row" style="display:none;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
 
309
- <textarea class="dmb_data_dump" name="tmm_data_dumps[]"></textarea>
310
 
311
- <!-- Member handle bar -->
312
- <div class="dmb_handle">
313
- <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_up" href="#" title="Move up"><span class="dashicons dashicons-arrow-up-alt2"></span></a>
314
- <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_down" href="#" title="Move down"><span class="dashicons dashicons-arrow-down-alt2"></span></a>
315
- <div class="dmb_handle_title"></div>
316
- <a class="dmb_button dmb_button_large dmb_button_compact dmb_remove_row_btn" href="#" title="Remove"><span class="dashicons dashicons-trash"></span></a>
317
- <a class="dmb_button dmb_button_large dmb_clone_row" href="#" title="Clone"><span class="dashicons dashicons-admin-page"></span><?php _e('Clone', TMM_TXTDM ); ?></a>
318
- <div class="dmb_clearfix"></div>
319
- </div>
320
 
321
- <!-- START inner -->
322
- <div class="dmb_inner">
 
 
 
323
 
324
- <div class="dmb_section_title">
325
- <?php _e('Member details', TMM_TXTDM ) ?>
326
- </div>
327
-
328
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
329
- <div class="dmb_field_title">
330
- <?php _e('First name', TMM_TXTDM ) ?>
 
 
 
 
 
331
  </div>
332
- <input class="dmb_field dmb_highlight_field dmb_firstname_of_member" type="text" value="" placeholder="<?php _e('e.g. John', TMM_TXTDM ) ?>" />
333
- </div>
334
 
335
- <div class="dmb_grid dmb_grid_33 ">
336
- <div class="dmb_field_title">
337
- <?php _e('Lastname', TMM_TXTDM ) ?>
 
 
 
 
 
338
  </div>
339
- <input class="dmb_field dmb_lastname_of_member" type="text" value="" placeholder="<?php _e('e.g. Doe', TMM_TXTDM ) ?>" />
340
- </div>
341
 
342
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
343
- <div class="dmb_field_title">
344
- <?php _e('Job/role', TMM_TXTDM ) ?>
 
 
 
345
  </div>
346
- <input class="dmb_field dmb_job_of_member" type="text" value="" placeholder="<?php _e('e.g. Project manager', TMM_TXTDM ) ?>" />
347
- </div>
348
-
349
- <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
350
 
351
-
352
- <?php if( !class_exists('acf') ) { ?>
353
 
354
- <div class="dmb_field_title">
355
- <?php _e('Description/biography', TMM_TXTDM ) ?>
356
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Edit your member\'s biography by clicking the button below. Once updated, it will show up here.', TMM_TXTDM ) ?>">[?]</a>
357
- </div>
 
 
 
358
 
359
- <div class="dmb_field dmb_description_of_member"></div>
 
 
 
360
 
361
- <?php } else { ?>
 
 
 
 
 
362
 
363
- <div class="dmb_field_title">
364
- <?php _e('Description/biography', TMM_TXTDM ) ?>
365
- </div>
 
 
 
 
366
 
367
- <div class="dmb_field dmb_description_of_member_fb" style="display:none !important;"></div>
368
- <textarea id="acf-fallback-bio"></textarea>
 
 
369
 
370
- <?php } ?>
 
 
 
371
 
372
- <div class="dmb_clearfix"></div>
373
 
374
- <?php if( !class_exists('acf') ) { ?>
375
- <div class="dmb_edit_description_of_member dmb_button dmb_button_large dmb_button_blue">
376
- <?php _e('Edit biography', TMM_TXTDM ) ?>
377
- </div>
378
- <?php } ?>
379
 
380
- </div>
381
 
382
- <div class="dmb_clearfix"></div>
 
 
383
 
384
- <div class="dmb_section_title">
385
- <?php _e('Social links', TMM_TXTDM ) ?>
386
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('These links will appear below your members\' biography.', TMM_TXTDM ) ?>">[?]</a>
387
- </div>
388
-
389
- <div class="dmb_clearfix"></div>
390
-
391
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
392
- <div class="dmb_field_title">
393
- <?php _e('Link type', TMM_TXTDM ) ?>
394
- </div>
395
-
396
- <select class="dmb_scl_type_select dmb_scl_type1_of_member">
397
- <?php foreach ( $social_links_options as $label => $value ) { ?>
398
- <option value="<?php echo $value; ?>"><?php echo $label; ?></option>
399
- <?php } ?>
400
- </select>
401
- </div>
402
 
403
- <div class="dmb_grid dmb_grid_33">
404
- <div class="dmb_field_title">
405
- <?php _e('Title attribute', TMM_TXTDM ) ?>
406
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Optional. This is the HTML <a> tag\'s title attribute.', TMM_TXTDM ) ?>">[?]</a>
407
- </div>
408
- <input class="dmb_field dmb_scl_title1_of_member" type="text" value="" placeholder="<?php _e('e.g. Facebook page', TMM_TXTDM ) ?>" />
409
- </div>
410
-
411
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
412
- <div class="dmb_field_title">
413
- <?php _e('Link URL', TMM_TXTDM ) ?>
414
- </div>
415
- <input class="dmb_field dmb_scl_url1_of_member" type="text" value="" placeholder="<?php _e('e.g. http://fb.com/member-profile', TMM_TXTDM ) ?>" />
416
- </div>
417
 
418
- <div class="dmb_clearfix" style="margin-bottom:6px"></div>
 
 
 
 
 
419
 
420
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
421
- <select class="dmb_scl_type_select dmb_scl_type2_of_member">
422
- <?php foreach ( $social_links_options as $label => $value ) { ?>
423
- <option value="<?php echo $value; ?>"><?php echo $label; ?></option>
424
- <?php } ?>
425
- </select>
426
- </div>
427
 
428
- <div class="dmb_grid dmb_grid_33">
429
- <input class="dmb_field dmb_scl_title2_of_member" type="text" value="" placeholder="<?php _e('e.g. Twitter page', TMM_TXTDM ) ?>" />
430
- </div>
 
 
 
 
 
 
431
 
432
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
433
- <input class="dmb_field dmb_scl_url2_of_member" type="text" value="" placeholder="<?php _e('e.g. http://tw.com/member-profile', TMM_TXTDM ) ?>" />
434
- </div>
435
 
436
- <div class="dmb_clearfix" style="margin-bottom:6px"></div>
 
437
 
438
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
439
- <select class="dmb_scl_type_select dmb_scl_type3_of_member">
440
- <?php foreach ( $social_links_options as $label => $value ) { ?>
441
- <option value="<?php echo $value; ?>"><?php echo $label; ?></option>
442
- <?php } ?>
443
- </select>
444
- </div>
445
 
446
- <div class="dmb_grid dmb_grid_33">
447
- <input class="dmb_field dmb_scl_title3_of_member" type="text" value="" placeholder="<?php _e('e.g. Google+ page', TMM_TXTDM ) ?>" />
448
- </div>
449
 
450
- <div class="dmb_grid dmb_grid_33 dmb_grid_last">
451
- <input class="dmb_field dmb_scl_url3_of_member" type="text" value="" placeholder="<?php _e('e.g. http://gp.com/member-profile', TMM_TXTDM ) ?>" />
452
- </div>
453
 
454
- <div class="dmb_clearfix"></div>
455
-
456
- <div class="dmb_tip">
457
- <span class="dashicons dashicons-yes"></span> Links with the email type open your visitors' mail client. <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Your member\'s email address must be entered in the Link URL field. Title attribute can be left blank.', TMM_TXTDM ) ?>">[?]</a>
458
- </div>
459
-
460
- <div class="dmb_clearfix"></div>
461
-
462
- <div class="dmb_section_title">
463
- <?php _e('Photo', TMM_TXTDM ) ?>
464
- </div>
465
-
466
- <div class="dmb_grid dmb_grid_33 dmb_grid_first">
467
-
468
- <div class="dmb_field_title">
469
- <?php _e('Member\'s photo', TMM_TXTDM ) ?>
470
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('We recommend that all photos are the same sizes.', TMM_TXTDM ) ?>">[?]</a>
471
- </div>
472
-
473
- <div class="dmb_photo_of_member">
474
- <div class="dmb_field_title dmb_img_data_url" data-img=""></div>
475
- <div class="dmb_upload_img_btn dmb_button dmb_button_large dmb_button_blue">
476
- <?php _e('Upload photo', TMM_TXTDM ) ?>
477
- </div>
478
- </div>
479
-
480
- </div>
481
-
482
- <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last" style="margin-top:7px;">
483
- <div class="dmb_field_title">
484
- <?php _e('Photo link', TMM_TXTDM ) ?>
485
- <a class="dmb_inline_tip dmb_tooltip_large" data-tooltip="<?php _e('Your visitors will be redirected to this link if they click the member\'s photo.', TMM_TXTDM ) ?>">[?]</a>
486
- </div>
487
- <input class="dmb_field dmb_photo_url_of_member" type="text" value="" placeholder="<?php _e('e.g. http://your-site.com/full-member-page/', TMM_TXTDM ) ?>" />
488
- </div>
489
-
490
- <div class="dmb_clearfix" style="margin-bottom:6px"></div>
491
-
492
- <!-- END inner -->
493
- </div>
494
-
495
- <!-- END empty row -->
496
- </div>
497
-
498
- <div class="dmb_clearfix"></div>
499
-
500
- <div class="dmb_no_row_notice">
501
- <?php /* translators: Leave HTML tags */ _e('Click the <strong>Add a member</strong> button below to get started.', TMM_TXTDM ) ?>
502
- </div>
503
-
504
- <!-- Add row button -->
505
- <a class="dmb_button dmb_button_huge dmb_button_green dmb_add_row" href="#">
506
- <?php _e('Add a member', TMM_TXTDM ) ?>
507
- </a>
508
 
509
  <?php }
1
  <?php
2
 
3
  /* Defines highlight select options. */
4
+ function dmb_tmm_social_links_options()
5
+ {
6
+ $options = array(
7
+ __('-', TMM_TXTDM) => 'nada',
8
+ __('Twitter', TMM_TXTDM) => 'twitter',
9
+ __('LinkedIn', TMM_TXTDM) => 'linkedin',
10
+ __('YouTube', TMM_TXTDM) => 'youtube',
11
+ __('Google+', TMM_TXTDM) => 'googleplus',
12
+ __('Facebook', TMM_TXTDM) => 'facebook',
13
+ __('Pinterest', TMM_TXTDM) => 'pinterest',
14
+ __('VK', TMM_TXTDM) => 'vk',
15
+ __('Instagram', TMM_TXTDM) => 'instagram',
16
+ __('Tumblr', TMM_TXTDM) => 'tumblr',
17
+ __('Research Gate', TMM_TXTDM) => 'researchgate',
18
+ __('Email', TMM_TXTDM) => 'email',
19
+ __('Website', TMM_TXTDM) => 'website',
20
+ __('Phone', TMM_TXTDM) => 'phone',
21
+ __('Other links', TMM_TXTDM) => 'customlink'
22
+ );
23
  return $options;
24
  }
25
 
 
26
  /* Hooks the metabox. */
27
  add_action('admin_init', 'dmb_tmm_add_team', 1);
28
+ function dmb_tmm_add_team()
29
+ {
30
+ add_meta_box(
31
+ 'tmm',
32
+ __('Manage your team', TMM_TXTDM),
33
  'dmb_tmm_team_display', // Below
34
+ 'tmm',
35
+ 'normal',
36
  'high'
37
  );
38
  }
39
 
 
40
  /* Displays the metabox. */
41
+ function dmb_tmm_team_display()
42
+ {
43
 
44
  global $post;
45
+
46
  /* Gets team data. */
47
+ $team = get_post_meta($post->ID, '_tmm_head', true);
48
+
49
  $fields_to_process = array(
50
+ '_tmm_firstname',
51
+ '_tmm_lastname',
52
+ '_tmm_job',
53
+ '_tmm_desc',
54
+ '_tmm_sc_type1', '_tmm_sc_title1', '_tmm_sc_url1',
55
+ '_tmm_sc_type2', '_tmm_sc_title2', '_tmm_sc_url2',
56
+ '_tmm_sc_type3', '_tmm_sc_title3', '_tmm_sc_url3',
57
+ '_tmm_photo',
58
+ '_tmm_photo_url'
59
  );
60
 
61
  /* Retrieves select options. */
62
  $social_links_options = dmb_tmm_social_links_options();
63
 
64
+ wp_nonce_field('dmb_tmm_meta_box_nonce', 'dmb_tmm_meta_box_nonce'); ?>
65
+
66
+ <div id="dmb_preview_team">
67
+ <!-- Closes preview button. -->
68
+ <a class="dmb_button dmb_button_huge dmb_button_gold dmb_preview_team_close" href="#">
69
+ <?php esc_html_e('Close preview', TMM_TXTDM) ?>
70
+ </a>
71
+ </div>
72
+
73
+ <?php if (!class_exists('acf')) { ?>
74
+
75
+ <div id="dmb_unique_editor">
76
+ <?php wp_editor('', 'dmb_editor', array('editor_height' => '300px')); ?>
77
+ <br />
78
+ <a class="dmb_button dmb_button_huge dmb_button_blue dmb_ue_update" href="#">
79
+ <?php esc_html_e('Update biography', TMM_TXTDM) ?>
80
+ </a>
81
+ <a class="dmb_button dmb_button_huge dmb_ue_cancel" href="#">
82
+ <?php esc_html_e('Cancel', TMM_TXTDM) ?>
83
+ </a>
84
+ </div>
85
+
86
+ <?php } ?>
87
+
88
+ <!-- Toolbar for member metabox -->
89
+ <div class="dmb_toolbar">
90
+ <a class="dmb_button dmb_button_large dmb_expand_rows" href="#"><span
91
+ class="dashicons dashicons-editor-expand"></span> <?php esc_html_e('Expand all', TMM_TXTDM) ?></a>
92
+ <a class="dmb_button dmb_button_large dmb_collapse_rows" href="#"><span
93
+ class="dashicons dashicons-editor-contract"></span> <?php esc_html_e('Collapse all', TMM_TXTDM) ?></a>
94
+ <a
95
+ class="dmb_show_preview_team dmb_button dmb_button_huge dmb_button_gold"><?php esc_html_e('Instant preview', TMM_TXTDM) ?></a>
96
+ <div class="dmb_clearfix"></div>
97
+ </div>
98
+
99
+ <?php if ($team) {
100
 
101
  /* Loops through rows. */
102
+ foreach ($team as $team_member) {
103
 
104
  /* Retrieves each field for current member. */
105
  $member = array();
106
+ foreach ($fields_to_process as $field) {
107
  switch ($field) {
108
  default:
109
+ $member[$field] = (isset($team_member[$field])) ? esc_attr($team_member[$field]) : '';
110
  break;
111
  }
112
  } ?>
113
 
114
+ <!-- START member -->
115
+ <div class="dmb_main">
116
+
117
+ <textarea class="dmb_data_dump" name="tmm_data_dumps[]"></textarea>
118
+
119
+ <!-- Member handle bar -->
120
+ <div class="dmb_handle">
121
+ <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_up" href="#" title="Move up"><span
122
+ class="dashicons dashicons-arrow-up-alt2"></span></a>
123
+ <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_down" href="#" title="Move down"><span
124
+ class="dashicons dashicons-arrow-down-alt2"></span></a>
125
+ <div class="dmb_handle_title"></div>
126
+ <a class="dmb_button dmb_button_large dmb_button_compact dmb_remove_row_btn" href="#" title="Remove"><span
127
+ class="dashicons dashicons-trash"></span></a>
128
+ <a class="dmb_button dmb_button_large dmb_clone_row" href="#" title="Clone"><span
129
+ class="dashicons dashicons-admin-page"></span><?php esc_html_e('Clone', TMM_TXTDM); ?></a>
130
+ <div class="dmb_clearfix"></div>
131
+ </div>
132
+
133
+ <!-- START inner -->
134
+ <div class="dmb_inner">
135
+
136
+ <div class="dmb_section_title">
137
+ <?php esc_html_e('Member details', TMM_TXTDM) ?>
138
+ </div>
139
 
140
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
141
+ <div class="dmb_field_title">
142
+ <?php esc_html_e('First name', TMM_TXTDM) ?>
143
+ </div>
144
+ <input class="dmb_field dmb_highlight_field dmb_firstname_of_member" type="text"
145
+ value="<?php echo wp_kses_post($member['_tmm_firstname']); ?>"
146
+ placeholder="<?php esc_attr_e('e.g. John', TMM_TXTDM) ?>" />
147
+ </div>
148
 
149
+ <div class="dmb_grid dmb_grid_33 ">
150
+ <div class="dmb_field_title">
151
+ <?php esc_html_e('Lastname', TMM_TXTDM) ?>
152
+ </div>
153
+ <input class="dmb_field dmb_lastname_of_member" type="text"
154
+ value="<?php echo wp_kses_post($member['_tmm_lastname']); ?>"
155
+ placeholder="<?php esc_html_e('e.g. Doe', TMM_TXTDM) ?>" />
156
+ </div>
157
 
158
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
159
+ <div class="dmb_field_title">
160
+ <?php esc_html_e('Job/role', TMM_TXTDM) ?>
161
+ </div>
162
+ <input class="dmb_field dmb_job_of_member" type="text"
163
+ value="<?php echo wp_kses_post($member['_tmm_job']); ?>"
164
+ placeholder="<?php esc_html_e('e.g. Project manager', TMM_TXTDM) ?>" />
165
+ </div>
166
 
167
+ <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
 
 
 
 
 
168
 
169
+ <?php if (!class_exists('acf')) { ?>
 
 
170
 
171
+ <div class="dmb_field_title">
172
+ <?php esc_html_e('Description/biography', TMM_TXTDM) ?>
173
+ <a class="dmb_inline_tip dmb_tooltip_large"
174
+ data-tooltip="<?php esc_attr_e('Edit your member\'s biography by clicking the button below. Once updated, it will show up here.', TMM_TXTDM) ?>">[?]</a>
175
+ </div>
176
 
177
+ <div class="dmb_field dmb_description_of_member">
178
+ <?php echo wp_kses_post($member["_tmm_desc"]); ?>
179
+ </div>
180
 
181
+ <?php } else { ?>
182
 
183
+ <div class="dmb_field_title">
184
+ <?php esc_html_e('Description/biography', TMM_TXTDM) ?>
185
+ </div>
186
 
187
+ <div class="dmb_field dmb_description_of_member_fb" style="display:none !important;">
188
+ <?php echo wp_kses_post($member["_tmm_desc"]); ?></div>
189
+ <textarea id="acf-fallback-bio"><?php echo wp_kses_post($member["_tmm_desc"]); ?></textarea>
190
 
191
+ <?php } ?>
192
 
193
+ <div class="dmb_clearfix"></div>
194
 
195
+ <?php if (!class_exists('acf')) { ?>
196
+ <div class="dmb_edit_description_of_member dmb_button dmb_button_large dmb_button_blue">
197
+ <?php esc_html_e('Edit biography', TMM_TXTDM) ?>
198
+ </div>
199
+ <?php } ?>
200
 
201
+ </div>
202
 
203
+ <div class="dmb_clearfix"></div>
204
 
205
+ <div class="dmb_section_title">
206
+ <?php esc_html_e('Social links', TMM_TXTDM) ?>
207
+ <a class="dmb_inline_tip dmb_tooltip_large"
208
+ data-tooltip="<?php esc_attr_e('These links will appear below your members\' biography.', TMM_TXTDM) ?>">[?]</a>
209
+ </div>
210
 
211
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
212
  <div class="dmb_field_title">
213
+ <?php esc_html_e('Link type', TMM_TXTDM) ?>
214
  </div>
215
  <select class="dmb_scl_type_select dmb_scl_type1_of_member">
216
+ <?php foreach ($social_links_options as $label => $value) { ?>
217
+ <option value="<?php echo wp_kses_post($value); ?>"
218
+ <?php selected($member['_tmm_sc_type1'], $value); ?>>
219
+ <?php echo esc_attr($label); ?></option>
220
+ <?php } ?>
221
  </select>
222
+ </div>
223
+
224
+ <div class="dmb_grid dmb_grid_33 ">
225
+ <div class="dmb_field_title">
226
+ <?php esc_html_e('Title attribute', TMM_TXTDM) ?>
227
+ <a class="dmb_inline_tip dmb_tooltip_large"
228
+ data-tooltip="<?php esc_attr_e('Optional. This is the HTML <a> tag\'s title attribute.', TMM_TXTDM) ?>">[?]</a>
229
+ </div>
230
+ <input class="dmb_field dmb_scl_title1_of_member" type="text"
231
+ value="<?php echo wp_kses_post($member['_tmm_sc_title1']); ?>"
232
+ placeholder="<?php esc_attr_e('e.g. Faceook page', TMM_TXTDM) ?>" />
233
+ </div>
234
+
235
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
236
+ <div class="dmb_field_title">
237
+ <?php esc_attr_e('Link URL', TMM_TXTDM) ?>
238
+ </div>
239
+ <input class="dmb_field dmb_scl_url1_of_member" type="text"
240
+ value="<?php echo wp_kses_post($member['_tmm_sc_url1']); ?>"
241
+ placeholder="<?php esc_attr_e('e.g. http://fb.com/member-profile', TMM_TXTDM) ?>" />
242
+ </div>
243
+
244
+ <div class="dmb_clearfix" style="margin-bottom:6px"></div>
245
+
246
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
247
  <select class="dmb_scl_type_select dmb_scl_type2_of_member">
248
+ <?php foreach ($social_links_options as $label => $value) { ?>
249
+ <option value="<?php echo wp_kses_post($value); ?>"
250
+ <?php selected($member['_tmm_sc_type2'], $value); ?>>
251
+ <?php echo esc_attr($label); ?></option>
252
+ <?php } ?>
253
  </select>
254
+ </div>
255
 
256
+ <div class="dmb_grid dmb_grid_33 ">
257
+ <input class="dmb_field dmb_scl_title2_of_member" type="text"
258
+ value="<?php echo wp_kses_post($member['_tmm_sc_title2']); ?>"
259
+ placeholder="<?php esc_attr_e('e.g. Twitter page', TMM_TXTDM) ?>" />
260
+ </div>
261
 
262
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
263
+ <input class="dmb_field dmb_scl_url2_of_member" type="text"
264
+ value="<?php echo wp_kses_post($member['_tmm_sc_url2']); ?>"
265
+ placeholder="<?php esc_attr_e('e.g. http://tw.com/member-profile', TMM_TXTDM) ?>" />
266
+ </div>
267
 
268
+ <div class="dmb_clearfix" style="margin-bottom:6px"></div>
269
 
270
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first dmb_grid_first">
271
  <select class="dmb_scl_type_select dmb_scl_type3_of_member">
272
+ <?php foreach ($social_links_options as $label => $value) { ?>
273
+ <option value="<?php echo wp_kses_post($value); ?>"
274
+ <?php selected($member['_tmm_sc_type3'], $value); ?>>
275
+ <?php echo esc_attr($label); ?></option>
276
+ <?php } ?>
277
  </select>
278
+ </div>
279
+
280
+ <div class="dmb_grid dmb_grid_33 ">
281
+ <input class="dmb_field dmb_scl_title3_of_member" type="text"
282
+ value="<?php echo wp_kses_post($member['_tmm_sc_title3']); ?>"
283
+ placeholder="<?php esc_attr_e('e.g. Google+ page', TMM_TXTDM) ?>" />
284
+ </div>
285
+
286
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
287
+ <input class="dmb_field dmb_scl_url3_of_member" type="text"
288
+ value="<?php echo wp_kses_post($member['_tmm_sc_url3']); ?>"
289
+ placeholder="<?php esc_attr_e('e.g. http://gp.com/member-profile', TMM_TXTDM) ?>" />
290
+ </div>
291
+
292
+ <div class="dmb_clearfix"></div>
293
+
294
+ <div class="dmb_tip">
295
+ <span class="dashicons dashicons-yes"></span>
296
+ <?php esc_html_e('Links with the email type open your visitors\' mail client.', TMM_TXTDM); ?> <a
297
+ class="dmb_inline_tip dmb_tooltip_large"
298
+ data-tooltip="<?php esc_attr_e('Your member\'s email address must be entered in the Link URL field. Title attribute can be left blank.', TMM_TXTDM) ?>">[?]</a>
299
+ <br /><span class="dashicons dashicons-yes"></span>
300
+ <?php esc_html_e('Links with the phone type open your visitors\' default phone app.', TMM_TXTDM) ?>
301
+ <a class="dmb_inline_tip dmb_tooltip_large"
302
+ data-tooltip="<?php esc_attr_e('Your member\'s phone number must be entered in the Link URL field (e.g. tel:+11234567890). Title attribute can be left blank.', TMM_TXTDM) ?>">[?]</a>
303
+ </div>
304
+
305
+ <div class="dmb_clearfix"></div>
306
+
307
+ <div class="dmb_section_title">
308
+ <?php esc_html_e('Photo', TMM_TXTDM) ?>
309
+ </div>
310
+
311
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
312
+
313
+ <div class="dmb_field_title">
314
+ <?php esc_html_e('Member\'s photo', TMM_TXTDM) ?>
315
+ <a class="dmb_inline_tip dmb_tooltip_large"
316
+ data-tooltip="<?php esc_attr_e('We recommend that all photos are the same sizes.', TMM_TXTDM) ?>">[?]</a>
317
+ </div>
318
+
319
+ <div class="dmb_photo_of_member">
320
+ <div class="dmb_field_title dmb_img_data_url"
321
+ data-img="<?php echo esc_attr_e($member['_tmm_photo']); ?>">
322
+ </div>
323
+ <div class="dmb_upload_img_btn dmb_button dmb_button_large dmb_button_blue">
324
+ <?php esc_html_e('Upload photo', TMM_TXTDM) ?>
325
+ </div>
326
+ </div>
327
+
328
+ </div>
329
+
330
+ <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last" style="margin-top:7px;">
331
+ <div class="dmb_field_title">
332
+ <?php esc_html_e('Photo link', TMM_TXTDM) ?>
333
+ <a class="dmb_inline_tip dmb_tooltip_large"
334
+ data-tooltip="<?php esc_attr_e('Your visitors will be redirected to this link if they click the member\'s photo.', TMM_TXTDM) ?>">[?]</a>
335
+ </div>
336
+ <input class="dmb_field dmb_photo_url_of_member" type="text"
337
+ value="<?php echo wp_kses_post($member['_tmm_photo_url']); ?>"
338
+ placeholder="<?php esc_attr_e('e.g. http://your-site.com/full-member-page/', TMM_TXTDM) ?>" />
339
+ </div>
340
+
341
+ <div class="dmb_clearfix" style="margin-bottom:6px"></div>
342
+
343
+ <!-- END inner -->
344
+ </div>
345
+
346
+ <!-- END row -->
347
+ </div>
348
+
349
+ <?php
350
  }
351
  } ?>
352
 
353
+ <!-- START empty member -->
354
+ <div class="dmb_main dmb_empty_row" style="display:none;">
355
+
356
+ <textarea class="dmb_data_dump" name="tmm_data_dumps[]"></textarea>
357
+
358
+ <!-- Member handle bar -->
359
+ <div class="dmb_handle">
360
+ <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_up" href="#" title="Move up"><span
361
+ class="dashicons dashicons-arrow-up-alt2"></span></a>
362
+ <a class="dmb_button dmb_button_large dmb_button_compact dmb_move_row_down" href="#" title="Move down"><span
363
+ class="dashicons dashicons-arrow-down-alt2"></span></a>
364
+ <div class="dmb_handle_title"></div>
365
+ <a class="dmb_button dmb_button_large dmb_button_compact dmb_remove_row_btn" href="#" title="Remove"><span
366
+ class="dashicons dashicons-trash"></span></a>
367
+ <a class="dmb_button dmb_button_large dmb_clone_row" href="#" title="Clone"><span
368
+ class="dashicons dashicons-admin-page"></span><?php esc_html_e('Clone', TMM_TXTDM); ?></a>
369
+ <div class="dmb_clearfix"></div>
370
+ </div>
371
+
372
+ <!-- START inner -->
373
+ <div class="dmb_inner">
374
+
375
+ <div class="dmb_section_title">
376
+ <?php esc_html_e('Member details', TMM_TXTDM) ?>
377
+ </div>
378
+
379
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
380
+ <div class="dmb_field_title">
381
+ <?php esc_html_e('First name', TMM_TXTDM) ?>
382
+ </div>
383
+ <input class="dmb_field dmb_highlight_field dmb_firstname_of_member" type="text" value=""
384
+ placeholder="<?php esc_attr_e('e.g. John', TMM_TXTDM) ?>" />
385
+ </div>
386
+
387
+ <div class="dmb_grid dmb_grid_33 ">
388
+ <div class="dmb_field_title">
389
+ <?php esc_html_e('Lastname', TMM_TXTDM) ?>
390
+ </div>
391
+ <input class="dmb_field dmb_lastname_of_member" type="text" value=""
392
+ placeholder="<?php esc_attr_e('e.g. Doe', TMM_TXTDM) ?>" />
393
+ </div>
394
+
395
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
396
+ <div class="dmb_field_title">
397
+ <?php esc_html_e('Job/role', TMM_TXTDM) ?>
398
+ </div>
399
+ <input class="dmb_field dmb_job_of_member" type="text" value=""
400
+ placeholder="<?php esc_attr_e('e.g. Project manager', TMM_TXTDM) ?>" />
401
+ </div>
402
+
403
+ <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
404
+
405
+ <?php if (!class_exists('acf')) { ?>
406
+
407
+ <div class="dmb_field_title">
408
+ <?php esc_html_e('Description/biography', TMM_TXTDM) ?>
409
+ <a class="dmb_inline_tip dmb_tooltip_large"
410
+ data-tooltip="<?php esc_attr_e('Edit your member\'s biography by clicking the button below. Once updated, it will show up here.', TMM_TXTDM) ?>">[?]</a>
411
+ </div>
412
+
413
+ <div class="dmb_field dmb_description_of_member"></div>
414
+
415
+ <?php } else { ?>
416
+
417
+ <div class="dmb_field_title">
418
+ <?php esc_html_e('Description/biography', TMM_TXTDM) ?>
419
+ </div>
420
+
421
+ <div class="dmb_field dmb_description_of_member_fb" style="display:none !important;"></div>
422
+ <textarea id="acf-fallback-bio"></textarea>
423
+
424
+ <?php } ?>
425
+
426
+ <div class="dmb_clearfix"></div>
427
+
428
+ <?php if (!class_exists('acf')) { ?>
429
+ <div class="dmb_edit_description_of_member dmb_button dmb_button_large dmb_button_blue">
430
+ <?php esc_html_e('Edit biography', TMM_TXTDM) ?>
431
+ </div>
432
+ <?php } ?>
433
 
434
+ </div>
435
 
436
+ <div class="dmb_clearfix"></div>
 
 
 
 
 
 
 
 
437
 
438
+ <div class="dmb_section_title">
439
+ <?php esc_html_e('Social links', TMM_TXTDM) ?>
440
+ <a class="dmb_inline_tip dmb_tooltip_large"
441
+ data-tooltip="<?php esc_attr_e('These links will appear below your members\' biography.', TMM_TXTDM) ?>">[?]</a>
442
+ </div>
443
 
444
+ <div class="dmb_clearfix"></div>
445
+
446
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
447
+ <div class="dmb_field_title">
448
+ <?php esc_html_e('Link type', TMM_TXTDM) ?>
449
+ </div>
450
+
451
+ <select class="dmb_scl_type_select dmb_scl_type1_of_member">
452
+ <?php foreach ($social_links_options as $label => $value) { ?>
453
+ <option value="<?php echo wp_kses_post($value); ?>"><?php echo esc_attr($label); ?></option>
454
+ <?php } ?>
455
+ </select>
456
  </div>
 
 
457
 
458
+ <div class="dmb_grid dmb_grid_33">
459
+ <div class="dmb_field_title">
460
+ <?php esc_html_e('Title attribute', TMM_TXTDM) ?>
461
+ <a class="dmb_inline_tip dmb_tooltip_large"
462
+ data-tooltip="<?php esc_attr_e('Optional. This is the HTML <a> tag\'s title attribute.', TMM_TXTDM) ?>">[?]</a>
463
+ </div>
464
+ <input class="dmb_field dmb_scl_title1_of_member" type="text" value=""
465
+ placeholder="<?php esc_attr_e('e.g. Facebook page', TMM_TXTDM) ?>" />
466
  </div>
 
 
467
 
468
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
469
+ <div class="dmb_field_title">
470
+ <?php esc_html_e('Link URL', TMM_TXTDM) ?>
471
+ </div>
472
+ <input class="dmb_field dmb_scl_url1_of_member" type="text" value=""
473
+ placeholder="<?php esc_attr_e('e.g. http://fb.com/member-profile', TMM_TXTDM) ?>" />
474
  </div>
 
 
 
 
475
 
476
+ <div class="dmb_clearfix" style="margin-bottom:6px"></div>
 
477
 
478
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
479
+ <select class="dmb_scl_type_select dmb_scl_type2_of_member">
480
+ <?php foreach ($social_links_options as $label => $value) { ?>
481
+ <option value="<?php echo wp_kses_post($value); ?>"><?php echo esc_attr($label); ?></option>
482
+ <?php } ?>
483
+ </select>
484
+ </div>
485
 
486
+ <div class="dmb_grid dmb_grid_33">
487
+ <input class="dmb_field dmb_scl_title2_of_member" type="text" value=""
488
+ placeholder="<?php esc_attr_e('e.g. Twitter page', TMM_TXTDM) ?>" />
489
+ </div>
490
 
491
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
492
+ <input class="dmb_field dmb_scl_url2_of_member" type="text" value=""
493
+ placeholder="<?php esc_attr_e('e.g. http://tw.com/member-profile', TMM_TXTDM) ?>" />
494
+ </div>
495
+
496
+ <div class="dmb_clearfix" style="margin-bottom:6px"></div>
497
 
498
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
499
+ <select class="dmb_scl_type_select dmb_scl_type3_of_member">
500
+ <?php foreach ($social_links_options as $label => $value) { ?>
501
+ <option value="<?php echo wp_kses_post($value); ?>"><?php echo esc_attr($label); ?></option>
502
+ <?php } ?>
503
+ </select>
504
+ </div>
505
 
506
+ <div class="dmb_grid dmb_grid_33">
507
+ <input class="dmb_field dmb_scl_title3_of_member" type="text" value=""
508
+ placeholder="<?php esc_attr_e('e.g. Google+ page', TMM_TXTDM) ?>" />
509
+ </div>
510
 
511
+ <div class="dmb_grid dmb_grid_33 dmb_grid_last">
512
+ <input class="dmb_field dmb_scl_url3_of_member" type="text" value=""
513
+ placeholder="<?php esc_attr_e('e.g. http://gp.com/member-profile', TMM_TXTDM) ?>" />
514
+ </div>
515
 
516
+ <div class="dmb_clearfix"></div>
517
 
518
+ <div class="dmb_tip">
519
+ <span class="dashicons dashicons-yes"></span> Links with the email type open your visitors' mail client. <a
520
+ class="dmb_inline_tip dmb_tooltip_large"
521
+ data-tooltip="<?php esc_attr_e('Your member\'s email address must be entered in the Link URL field. Title attribute can be left blank.', TMM_TXTDM) ?>">[?]</a>
522
+ </div>
523
 
524
+ <div class="dmb_clearfix"></div>
525
 
526
+ <div class="dmb_section_title">
527
+ <?php esc_html_e('Photo', TMM_TXTDM) ?>
528
+ </div>
529
 
530
+ <div class="dmb_grid dmb_grid_33 dmb_grid_first">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
 
532
+ <div class="dmb_field_title">
533
+ <?php esc_html_e('Member\'s photo', TMM_TXTDM) ?>
534
+ <a class="dmb_inline_tip dmb_tooltip_large"
535
+ data-tooltip="<?php esc_attr_e('We recommend that all photos are the same sizes.', TMM_TXTDM) ?>">[?]</a>
536
+ </div>
 
 
 
 
 
 
 
 
 
537
 
538
+ <div class="dmb_photo_of_member">
539
+ <div class="dmb_field_title dmb_img_data_url" data-img=""></div>
540
+ <div class="dmb_upload_img_btn dmb_button dmb_button_large dmb_button_blue">
541
+ <?php esc_html_e('Upload photo', TMM_TXTDM) ?>
542
+ </div>
543
+ </div>
544
 
545
+ </div>
 
 
 
 
 
 
546
 
547
+ <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last" style="margin-top:7px;">
548
+ <div class="dmb_field_title">
549
+ <?php esc_html_e('Photo link', TMM_TXTDM) ?>
550
+ <a class="dmb_inline_tip dmb_tooltip_large"
551
+ data-tooltip="<?php esc_attr_e('Your visitors will be redirected to this link if they click the member\'s photo.', TMM_TXTDM) ?>">[?]</a>
552
+ </div>
553
+ <input class="dmb_field dmb_photo_url_of_member" type="text" value=""
554
+ placeholder="<?php esc_attr_e('e.g. http://your-site.com/full-member-page/', TMM_TXTDM) ?>" />
555
+ </div>
556
 
557
+ <div class="dmb_clearfix" style="margin-bottom:6px"></div>
 
 
558
 
559
+ <!-- END inner -->
560
+ </div>
561
 
562
+ <!-- END empty row -->
563
+ </div>
 
 
 
 
 
564
 
565
+ <div class="dmb_clearfix"></div>
 
 
566
 
567
+ <div class="dmb_no_row_notice">
568
+ <?php /* translators: Leave HTML tags */ esc_html_e('Click the Add a member button below to get started.', TMM_TXTDM) ?>
569
+ </div>
570
 
571
+ <!-- Add row button -->
572
+ <a class="dmb_button dmb_button_huge dmb_button_green dmb_add_row" href="#">
573
+ <?php esc_html_e('Add a member', TMM_TXTDM) ?>
574
+ </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
575
 
576
  <?php }
inc/tmm-metaboxes-pro.php CHANGED
@@ -1,55 +1,61 @@
1
- <?php
2
 
3
  /* Hooks the metabox. */
4
  add_action('admin_init', 'dmb_tmm_add_pro', 1);
5
- function dmb_tmm_add_pro() {
6
- add_meta_box(
7
- 'tmm_pro',
8
- 'Upgrade to PRO',
9
- 'dmb_tmm_pro_display', // Below
10
- 'tmm',
11
- 'side',
12
- 'high'
13
- );
 
14
  }
15
 
16
 
17
  /* Displays the metabox. */
18
- function dmb_tmm_pro_display() { ?>
 
19
 
20
- <div class="dmb_side_block">
21
- <div class="dmb_side_block_title">
22
- <span class="dashicons dashicons-yes" style="color:#81c240;"></span> <strong>Import/export</strong> members from one team to another.
23
- </div>
24
- <div class="dmb_side_block_title">
25
- <span class="dashicons dashicons-yes" style="color:#81c240;"></span> <strong>Equalizer</strong>: Make the length of your member boxes the same.
26
- </div>
27
- <div class="dmb_side_block_title">
28
- <span class="dashicons dashicons-yes" style="color:#81c240;"></span> Add a <strong>second photo</strong> that will appear when hovering over the first one.
29
- </div>
30
- <div class="dmb_side_block_title">
31
- <span class="dashicons dashicons-yes" style="color:#81c240;"></span> <strong>Hide members</strong> from the team.
32
- </div>
33
- <div class="dmb_side_block_title">
34
- <span class="dashicons dashicons-yes" style="color:#81c240;"></span> Add a read more <strong>toggle box</strong>.
35
- </div>
36
- <div class="dmb_side_block_title">
37
- <span class="dashicons dashicons-yes" style="color:#81c240;"></span> Many more features.
38
- </div>
39
-
40
- </div>
41
-
 
 
42
 
43
- <a class="dmb_button dmb_button_huge dmb_button_green dmb_see_pro" target="_blank" href="https://wpdarko.com/items/team-members-pro">
44
- See all the new features&nbsp;
45
- </a>
46
- <div class="dmb_discount_box_pushr"></div>
47
- <div class="dmb_side_block dmb_discount_box">
48
- <div class="dmb_side_block_title">
49
- Discount code
50
- </div>
51
- <span style="font-size:14px; color:#75b03a;"><strong>7884661</strong> (10% OFF)</span>
52
- </div>
53
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  <?php } ?>
1
+ <?php
2
 
3
  /* Hooks the metabox. */
4
  add_action('admin_init', 'dmb_tmm_add_pro', 1);
5
+ function dmb_tmm_add_pro()
6
+ {
7
+ add_meta_box(
8
+ 'tmm_pro',
9
+ 'Upgrade to PRO',
10
+ 'dmb_tmm_pro_display', // Below
11
+ 'tmm',
12
+ 'side',
13
+ 'high'
14
+ );
15
  }
16
 
17
 
18
  /* Displays the metabox. */
19
+ function dmb_tmm_pro_display()
20
+ { ?>
21
 
22
+ <div class="dmb_side_block">
23
+ <div class="dmb_side_block_title">
24
+ <span class="dashicons dashicons-yes" style="color:#81c240;"></span> <strong>Import/export</strong> members from
25
+ one team to another.
26
+ </div>
27
+ <div class="dmb_side_block_title">
28
+ <span class="dashicons dashicons-yes" style="color:#81c240;"></span> <strong>Equalizer</strong>: Make the length
29
+ of your member boxes the same.
30
+ </div>
31
+ <div class="dmb_side_block_title">
32
+ <span class="dashicons dashicons-yes" style="color:#81c240;"></span> Add a <strong>second photo</strong> that
33
+ will appear when hovering over the first one.
34
+ </div>
35
+ <div class="dmb_side_block_title">
36
+ <span class="dashicons dashicons-yes" style="color:#81c240;"></span> <strong>Hide members</strong> from the
37
+ team.
38
+ </div>
39
+ <div class="dmb_side_block_title">
40
+ <span class="dashicons dashicons-yes" style="color:#81c240;"></span> Add a read more <strong>toggle
41
+ box</strong>.
42
+ </div>
43
+ <div class="dmb_side_block_title">
44
+ <span class="dashicons dashicons-yes" style="color:#81c240;"></span> Many more features.
45
+ </div>
46
 
47
+ </div>
 
 
 
 
 
 
 
 
 
48
 
49
+ <a class="dmb_button dmb_button_huge dmb_button_green dmb_see_pro" target="_blank"
50
+ href="https://wpdarko.com/items/team-members-pro">
51
+ See all the new features&nbsp;
52
+ </a>
53
+ <div class="dmb_discount_box_pushr"></div>
54
+ <div class="dmb_side_block dmb_discount_box">
55
+ <div class="dmb_side_block_title">
56
+ Discount code
57
+ </div>
58
+ <span style="font-size:14px; color:#75b03a;"><strong>7884661</strong> (10% OFF)</span>
59
+ </div>
60
 
61
  <?php } ?>
inc/tmm-metaboxes-settings.php CHANGED
@@ -1,67 +1,69 @@
1
- <?php
2
 
3
  /* Defines force font select options. */
4
- function dmb_tmm_force_fonts_options() {
5
- $options = array (
6
- __('Use plugin defaults', TMM_TXTDM ) => 'yes',
7
- __('Use fonts from my theme', TMM_TXTDM ) => 'no'
 
8
  );
9
  return $options;
10
  }
11
 
12
-
13
  /* Defines picture link behavior options. */
14
- function dmb_tmm_piclink_beh_options(){
15
- $options = array (
16
- __('New window', TMM_TXTDM ) => 'new',
17
- __('Same window', TMM_TXTDM ) => 'same'
 
18
  );
19
  return $options;
20
  }
21
 
22
-
23
  /* Defines bio alignment options. */
24
- function dmb_tmm_bio_align_options() {
25
- $options = array (
 
26
  __('Center', TMM_TXTDM) => 'center',
27
  __('Left', TMM_TXTDM) => 'left',
28
  __('Right', TMM_TXTDM) => 'right',
29
- __('Justify', TMM_TXTDM) => 'justify'
30
  );
31
  return $options;
32
  }
33
 
34
-
35
  /* Defines team columns options. */
36
- function dmb_tmm_columns_options() {
37
- $options = array (
 
38
  __('1 per line', TMM_TXTDM) => '1',
39
  __('2 per line', TMM_TXTDM) => '2',
40
  __('3 per line', TMM_TXTDM) => '3',
41
  __('4 per line', TMM_TXTDM) => '4',
42
- __('5 per line', TMM_TXTDM) => '5'
43
  );
44
  return $options;
45
  }
46
 
47
-
48
  /* Hooks the metabox. */
49
  add_action('admin_init', 'dmb_tmm_add_settings', 1);
50
- function dmb_tmm_add_settings() {
51
- add_meta_box(
52
- 'tmm_settings',
53
- 'Settings',
54
- 'dmb_tmm_settings_display',
55
- 'tmm',
56
- 'side',
 
57
  'high'
58
  );
59
  }
60
 
61
 
62
  /* Displays the metabox. */
63
- function dmb_tmm_settings_display() {
64
-
 
65
  global $post;
66
 
67
  /* Retrieves select options. */
@@ -73,76 +75,89 @@ function dmb_tmm_settings_display() {
73
  /* Processes retrieved fields. */
74
  $settings = array();
75
 
76
- $settings['_tmm_columns'] = get_post_meta( $post->ID, '_tmm_columns', true );
77
- if (!$settings['_tmm_columns']) { $settings['_tmm_columns'] = '3'; }
 
 
78
 
79
- $settings['_tmm_color'] = get_post_meta( $post->ID, '_tmm_color', true );
80
- if (!$settings['_tmm_color']) { $settings['_tmm_color'] = '#333333'; }
 
 
81
 
82
- $settings['_tmm_bio_alignment'] = get_post_meta( $post->ID, '_tmm_bio_alignment', true );
83
 
84
  /* Checks if member links open in new window. */
85
- $settings['_tmm_piclink_beh'] = get_post_meta( $post->ID, '_tmm_piclink_beh', true );
86
  ($settings['_tmm_piclink_beh'] == 'new' ? $tmm_plb = 'target="_blank"' : $tmm_plb = '');
87
 
88
  /* Checks if forcing original fonts. */
89
- $settings['_tmm_original_font'] = get_post_meta( $post->ID, '_tmm_original_font', true );
90
- if (!$settings['_tmm_original_font']) { $settings['_tmm_original_font'] = 'yes'; }
91
-
92
- ?>
93
-
94
- <div class="dmb_settings_box dmb_sidebar">
95
-
96
- <div class="dmb_section_title">
97
- <?php /* translators: General settings */ _e('General', TMM_TXTDM) ?>
98
- </div>
99
-
100
- <!-- Team layout -->
101
- <div class="dmb_grid dmb_grid_50 dmb_grid_first">
102
- <div class="dmb_field_title">
103
- <?php _e('Members per line', TMM_TXTDM ) ?>
104
- </div>
105
- <select class="dmb_side_select" name="team_columns">
106
- <?php foreach ( $team_columns as $label => $value ) { ?>
107
- <option value="<?php echo $value; ?>"<?php selected( (isset($settings['_tmm_columns'])) ? $settings['_tmm_columns'] : '3', $value ); ?>><?php echo $label; ?></option>
108
- <?php } ?>
109
- </select>
110
- </div>
111
-
112
- <!-- Photo link behavior -->
113
- <div class="dmb_grid dmb_grid_50 dmb_grid_last">
114
- <div class="dmb_field_title">
115
- <?php _e('Photo link behavior', TMM_TXTDM ) ?>
116
- </div>
117
- <select class="dmb_side_select" name="team_piclink_beh">
118
- <?php foreach ( $team_piclink_beh as $label => $value ) { ?>
119
- <option value="<?php echo $value; ?>"<?php selected( (isset($settings['_tmm_piclink_beh'])) ? $settings['_tmm_piclink_beh'] : 'new', $value ); ?>><?php echo $label; ?></option>
120
- <?php } ?>
121
- </select>
122
- </div>
123
-
124
- <!-- Font option -->
125
- <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
126
- <div class="dmb_field_title">
127
- <?php _e('Fonts to use', TMM_TXTDM ) ?>
128
- </div>
129
- <select class="dmb_side_select" name="team_force_font">
130
- <?php foreach ( $team_force_font as $label => $value ) { ?>
131
- <option value="<?php echo $value; ?>"<?php selected( (isset($settings['_tmm_original_font'])) ? $settings['_tmm_original_font'] : 'yes', $value ); ?>><?php echo $label; ?></option>
132
- <?php } ?>
133
- </select>
134
- </div>
135
-
136
- <!-- Main color -->
137
- <div class="dmb_color_of_team dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
138
- <div class="dmb_field_title">
139
- <?php _e('Main color', TMM_TXTDM) ?>
140
- </div>
141
- <input class="dmb_color_picker dmb_field dmb_color_of_team" name="team_color" type="text" value="<?php echo (isset($settings['_tmm_color'])) ? $settings['_tmm_color'] : '#333333'; ?>" />
142
- </div>
143
-
144
- <div class="dmb_clearfix"></div>
145
-
146
- </div>
 
 
 
 
 
 
 
 
 
147
 
148
  <?php } ?>
1
+ <?php
2
 
3
  /* Defines force font select options. */
4
+ function dmb_tmm_force_fonts_options()
5
+ {
6
+ $options = array(
7
+ __('Use plugin defaults', TMM_TXTDM) => 'yes',
8
+ __('Use fonts from my theme', TMM_TXTDM) => 'no'
9
  );
10
  return $options;
11
  }
12
 
 
13
  /* Defines picture link behavior options. */
14
+ function dmb_tmm_piclink_beh_options()
15
+ {
16
+ $options = array(
17
+ __('New window', TMM_TXTDM) => 'new',
18
+ __('Same window', TMM_TXTDM) => 'same'
19
  );
20
  return $options;
21
  }
22
 
 
23
  /* Defines bio alignment options. */
24
+ function dmb_tmm_bio_align_options()
25
+ {
26
+ $options = array(
27
  __('Center', TMM_TXTDM) => 'center',
28
  __('Left', TMM_TXTDM) => 'left',
29
  __('Right', TMM_TXTDM) => 'right',
30
+ __('Justify', TMM_TXTDM) => 'justify'
31
  );
32
  return $options;
33
  }
34
 
 
35
  /* Defines team columns options. */
36
+ function dmb_tmm_columns_options()
37
+ {
38
+ $options = array(
39
  __('1 per line', TMM_TXTDM) => '1',
40
  __('2 per line', TMM_TXTDM) => '2',
41
  __('3 per line', TMM_TXTDM) => '3',
42
  __('4 per line', TMM_TXTDM) => '4',
43
+ __('5 per line', TMM_TXTDM) => '5'
44
  );
45
  return $options;
46
  }
47
 
 
48
  /* Hooks the metabox. */
49
  add_action('admin_init', 'dmb_tmm_add_settings', 1);
50
+ function dmb_tmm_add_settings()
51
+ {
52
+ add_meta_box(
53
+ 'tmm_settings',
54
+ 'Settings',
55
+ 'dmb_tmm_settings_display',
56
+ 'tmm',
57
+ 'side',
58
  'high'
59
  );
60
  }
61
 
62
 
63
  /* Displays the metabox. */
64
+ function dmb_tmm_settings_display()
65
+ {
66
+
67
  global $post;
68
 
69
  /* Retrieves select options. */
75
  /* Processes retrieved fields. */
76
  $settings = array();
77
 
78
+ $settings['_tmm_columns'] = get_post_meta($post->ID, '_tmm_columns', true);
79
+ if (!$settings['_tmm_columns']) {
80
+ $settings['_tmm_columns'] = '3';
81
+ }
82
 
83
+ $settings['_tmm_color'] = get_post_meta($post->ID, '_tmm_color', true);
84
+ if (!$settings['_tmm_color']) {
85
+ $settings['_tmm_color'] = '#333333';
86
+ }
87
 
88
+ $settings['_tmm_bio_alignment'] = get_post_meta($post->ID, '_tmm_bio_alignment', true);
89
 
90
  /* Checks if member links open in new window. */
91
+ $settings['_tmm_piclink_beh'] = get_post_meta($post->ID, '_tmm_piclink_beh', true);
92
  ($settings['_tmm_piclink_beh'] == 'new' ? $tmm_plb = 'target="_blank"' : $tmm_plb = '');
93
 
94
  /* Checks if forcing original fonts. */
95
+ $settings['_tmm_original_font'] = get_post_meta($post->ID, '_tmm_original_font', true);
96
+ if (!$settings['_tmm_original_font']) {
97
+ $settings['_tmm_original_font'] = 'yes';
98
+ }
99
+
100
+ ?>
101
+
102
+ <div class="dmb_settings_box dmb_sidebar">
103
+
104
+ <div class="dmb_section_title">
105
+ <?php /* translators: General settings */ esc_html_e('General', TMM_TXTDM) ?>
106
+ </div>
107
+
108
+ <!-- Team layout -->
109
+ <div class="dmb_grid dmb_grid_50 dmb_grid_first">
110
+ <div class="dmb_field_title">
111
+ <?php esc_html_e('Members per line', TMM_TXTDM) ?>
112
+ </div>
113
+ <select class="dmb_side_select" name="team_columns">
114
+ <?php foreach ($team_columns as $label => $value) { ?>
115
+ <option value="<?php echo wp_kses_post($value); ?>"
116
+ <?php selected((isset($settings['_tmm_columns'])) ? $settings['_tmm_columns'] : '3', $value); ?>>
117
+ <?php echo esc_attr($label); ?></option>
118
+ <?php } ?>
119
+ </select>
120
+ </div>
121
+
122
+ <!-- Photo link behavior -->
123
+ <div class="dmb_grid dmb_grid_50 dmb_grid_last">
124
+ <div class="dmb_field_title">
125
+ <?php esc_html_e('Photo link behavior', TMM_TXTDM) ?>
126
+ </div>
127
+ <select class="dmb_side_select" name="team_piclink_beh">
128
+ <?php foreach ($team_piclink_beh as $label => $value) { ?>
129
+ <option value="<?php echo wp_kses_post($value); ?>"
130
+ <?php selected((isset($settings['_tmm_piclink_beh'])) ? $settings['_tmm_piclink_beh'] : 'new', $value); ?>>
131
+ <?php echo esc_attr($label); ?></option>
132
+ <?php } ?>
133
+ </select>
134
+ </div>
135
+
136
+ <!-- Font option -->
137
+ <div class="dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
138
+ <div class="dmb_field_title">
139
+ <?php esc_html_e('Fonts to use', TMM_TXTDM) ?>
140
+ </div>
141
+ <select class="dmb_side_select" name="team_force_font">
142
+ <?php foreach ($team_force_font as $label => $value) { ?>
143
+ <option value="<?php echo wp_kses_post($value); ?>"
144
+ <?php selected((isset($settings['_tmm_original_font'])) ? $settings['_tmm_original_font'] : 'yes', $value); ?>>
145
+ <?php echo esc_attr($label); ?></option>
146
+ <?php } ?>
147
+ </select>
148
+ </div>
149
+
150
+ <!-- Main color -->
151
+ <div class="dmb_color_of_team dmb_grid dmb_grid_100 dmb_grid_first dmb_grid_last">
152
+ <div class="dmb_field_title">
153
+ <?php esc_html_e('Main color', TMM_TXTDM) ?>
154
+ </div>
155
+ <input class="dmb_color_picker dmb_field dmb_color_of_team" name="team_color" type="text"
156
+ value="<?php echo (isset($settings['_tmm_color'])) ? wp_kses_post($settings['_tmm_color']) : '#333333'; ?>" />
157
+ </div>
158
+
159
+ <div class="dmb_clearfix"></div>
160
+
161
+ </div>
162
 
163
  <?php } ?>
inc/tmm-post-type.php CHANGED
@@ -1,64 +1,61 @@
1
- <?php
2
 
3
  /* Registers the teams post type. */
4
- add_action( 'init', 'register_tmm_type' );
5
- function register_tmm_type() {
6
-
7
- /* Defines labels. */
8
- $labels = array(
9
- 'name' => __( 'Teams', TMM_TXTDM ),
10
- 'singular_name' => __( 'Team', TMM_TXTDM ),
11
- 'menu_name' => __( 'Teams', TMM_TXTDM ),
12
- 'name_admin_bar' => __( 'Team', TMM_TXTDM ),
13
- 'add_new' => __( 'Add New', TMM_TXTDM ),
14
- 'add_new_item' => __( 'Add New Team', TMM_TXTDM ),
15
- 'new_item' => __( 'New Team', TMM_TXTDM ),
16
- 'edit_item' => __( 'Edit Team', TMM_TXTDM ),
17
- 'view_item' => __( 'View Team', TMM_TXTDM ),
18
- 'all_items' => __( 'All Teams', TMM_TXTDM ),
19
- 'search_items' => __( 'Search Teams', TMM_TXTDM ),
20
- 'not_found' => __( 'No Teams found.', TMM_TXTDM ),
21
- 'not_found_in_trash' => __( 'No Teams found in Trash.', TMM_TXTDM )
 
22
  );
23
 
24
- /* Defines permissions. */
25
  $args = array(
26
  'labels' => $labels,
27
  'public' => false,
28
  'publicly_queryable' => false,
29
  'show_ui' => true,
30
- 'show_in_admin_bar' => false,
31
  'capability_type' => 'post',
32
  'has_archive' => false,
33
  'hierarchical' => false,
34
- 'supports' => array( 'title' ),
35
- 'menu_icon' => 'dashicons-plus'
36
  );
37
 
38
- /* Registers post type. */
39
- register_post_type( 'tmm', $args );
40
-
41
  }
42
 
43
-
44
  /* Customizes teams update messages. */
45
- add_filter( 'post_updated_messages', 'tmm_updated_messages' );
46
- function tmm_updated_messages( $messages ) {
 
47
  $post = get_post();
48
- $post_type = get_post_type( $post );
49
- $post_type_object = get_post_type_object( $post_type );
50
-
51
- /* Defines update messages. */
52
  $messages['tmm'] = array(
53
- 1 => __( 'Team updated.', TMM_TXTDM ),
54
- 4 => __( 'Team updated.', TMM_TXTDM ),
55
- 6 => __( 'Team published.', TMM_TXTDM ),
56
- 7 => __( 'Team saved.', TMM_TXTDM ),
57
- 10 => __( 'Team draft updated.', TMM_TXTDM )
58
  );
59
 
60
  return $messages;
61
-
62
- }
63
-
64
- ?>
1
+ <?php
2
 
3
  /* Registers the teams post type. */
4
+ add_action('init', 'register_tmm_type');
5
+ function register_tmm_type()
6
+ {
7
+
8
+ /* Defines labels. */
9
+ $labels = array(
10
+ 'name' => __('Teams', TMM_TXTDM),
11
+ 'singular_name' => __('Team', TMM_TXTDM),
12
+ 'menu_name' => __('Teams', TMM_TXTDM),
13
+ 'name_admin_bar' => __('Team', TMM_TXTDM),
14
+ 'add_new' => __('Add New', TMM_TXTDM),
15
+ 'add_new_item' => __('Add New Team', TMM_TXTDM),
16
+ 'new_item' => __('New Team', TMM_TXTDM),
17
+ 'edit_item' => __('Edit Team', TMM_TXTDM),
18
+ 'view_item' => __('View Team', TMM_TXTDM),
19
+ 'all_items' => __('All Teams', TMM_TXTDM),
20
+ 'search_items' => __('Search Teams', TMM_TXTDM),
21
+ 'not_found' => __('No Teams found.', TMM_TXTDM),
22
+ 'not_found_in_trash' => __('No Teams found in Trash.', TMM_TXTDM)
23
  );
24
 
25
+ /* Defines permissions. */
26
  $args = array(
27
  'labels' => $labels,
28
  'public' => false,
29
  'publicly_queryable' => false,
30
  'show_ui' => true,
31
+ 'show_in_admin_bar' => false,
32
  'capability_type' => 'post',
33
  'has_archive' => false,
34
  'hierarchical' => false,
35
+ 'supports' => array('title'),
36
+ 'menu_icon' => 'dashicons-plus'
37
  );
38
 
39
+ /* Registers post type. */
40
+ register_post_type('tmm', $args);
 
41
  }
42
 
 
43
  /* Customizes teams update messages. */
44
+ add_filter('post_updated_messages', 'tmm_updated_messages');
45
+ function tmm_updated_messages($messages)
46
+ {
47
  $post = get_post();
48
+ $post_type = get_post_type($post);
49
+ $post_type_object = get_post_type_object($post_type);
50
+
51
+ /* Defines update messages. */
52
  $messages['tmm'] = array(
53
+ 1 => __('Team updated.', TMM_TXTDM),
54
+ 4 => __('Team updated.', TMM_TXTDM),
55
+ 6 => __('Team published.', TMM_TXTDM),
56
+ 7 => __('Team saved.', TMM_TXTDM),
57
+ 10 => __('Team draft updated.', TMM_TXTDM)
58
  );
59
 
60
  return $messages;
61
+ }
 
 
 
inc/tmm-pro-version-check.php CHANGED
@@ -1,22 +1,20 @@
1
  <?php
2
 
3
  /* Checks for PRO version. */
4
- add_action( 'admin_init', 'tmm_free_pro_check' );
5
- function tmm_free_pro_check() {
 
6
 
7
  if (is_plugin_active('team-members-pro/tmm_pro.php')) {
8
 
9
  /* Shows admin notice. */
10
  add_action('admin_notices', 'tmm_free_pro_notice');
11
- function tmm_free_pro_notice(){
 
12
  echo '<div class="updated"><p><span class="dashicons dashicons-unlock"></span> Team Members <strong>PRO</strong> was activated and is now taking over the Free version.</p></div>';
13
  }
14
-
15
- /* Deactivates free version. */
16
- deactivate_plugins( TMM_PATH.'/tmm.php' );
17
 
 
 
18
  }
19
-
20
- }
21
-
22
- ?>
1
  <?php
2
 
3
  /* Checks for PRO version. */
4
+ add_action('admin_init', 'tmm_free_pro_check');
5
+ function tmm_free_pro_check()
6
+ {
7
 
8
  if (is_plugin_active('team-members-pro/tmm_pro.php')) {
9
 
10
  /* Shows admin notice. */
11
  add_action('admin_notices', 'tmm_free_pro_notice');
12
+ function tmm_free_pro_notice()
13
+ {
14
  echo '<div class="updated"><p><span class="dashicons dashicons-unlock"></span> Team Members <strong>PRO</strong> was activated and is now taking over the Free version.</p></div>';
15
  }
 
 
 
16
 
17
+ /* Deactivates free version. */
18
+ deactivate_plugins(TMM_PATH . '/tmm.php');
19
  }
20
+ }
 
 
 
inc/tmm-save-metaboxes.php CHANGED
@@ -1,11 +1,14 @@
1
- <?php
2
 
3
  /* Saves metaboxes. */
4
  add_action('save_post', 'dmb_tmm_plan_meta_box_save');
5
- function dmb_tmm_plan_meta_box_save($post_id) {
 
6
 
7
- if ( ! isset( $_POST['dmb_tmm_meta_box_nonce'] ) ||
8
- ! wp_verify_nonce( $_POST['dmb_tmm_meta_box_nonce'], 'dmb_tmm_meta_box_nonce' ) )
 
 
9
  return;
10
 
11
  if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
@@ -14,6 +17,10 @@ function dmb_tmm_plan_meta_box_save($post_id) {
14
  if (!current_user_can('edit_post', $post_id))
15
  return;
16
 
 
 
 
 
17
  /* Gets members. */
18
  $old_team = get_post_meta($post_id, '_tmm_head', true);
19
 
@@ -23,102 +30,100 @@ function dmb_tmm_plan_meta_box_save($post_id) {
23
  /* Settings. */
24
  $old_team_settings = array();
25
 
26
- $old_team_settings['_tmm_columns'] = get_post_meta( $post_id, '_tmm_columns', true );
27
- $old_team_settings['_tmm_color'] = get_post_meta( $post_id, '_tmm_color', true );
28
- $old_team_settings['_tmm_bio_alignment'] = get_post_meta( $post_id, '_tmm_bio_alignment', true );
29
- $old_team_settings['_tmm_piclink_beh'] = get_post_meta( $post_id, '_tmm_piclink_beh', true );
30
- $old_team_settings['_tmm_original_font'] = get_post_meta( $post_id, '_tmm_original_font', true );
 
 
31
 
32
- $count = count($_POST['tmm_data_dumps']) - 1;
33
 
34
- for ( $i = 0; $i < $count; $i++ ) {
35
 
36
- if($_POST['tmm_data_dumps'][$i]){
 
 
 
37
 
38
- /* Data travels using a single field to avoid max_input_vars issue. */
39
- $member_data = explode(']--[', $_POST['tmm_data_dumps'][$i]);
40
-
41
  $member_firstname = $member_data[0];
42
  $member_lastname = $member_data[1];
43
  $member_job = $member_data[2];
44
  $member_bio = $member_data[3];
45
-
46
  $member_scl_type1 = $member_data[4];
47
  $member_scl_title1 = $member_data[5];
48
  $member_scl_url1 = $member_data[6];
49
-
50
  $member_scl_type2 = $member_data[7];
51
  $member_scl_title2 = $member_data[8];
52
  $member_scl_url2 = $member_data[9];
53
-
54
  $member_scl_type3 = $member_data[10];
55
  $member_scl_title3 = $member_data[11];
56
  $member_scl_url3 = $member_data[12];
57
-
58
  $member_photo = $member_data[13];
59
  $member_photo_url = $member_data[14];
60
 
61
- /* Saves the member if at least one of these fields are not empty. */
62
- if (
63
  $member_firstname != ''
64
- || $member_lastname != ''
65
  || $member_job != ''
66
  || $member_bio != ''
67
  || $member_photo != ''
68
  ) {
69
-
70
  /* Head. */
71
- (isset($member_firstname) && $member_firstname) ? $new_team[$i]['_tmm_firstname'] = stripslashes( wp_kses_post( $member_firstname ) ) : $new_team[$i]['_tmm_firstname'] = __('Untitled', TMM_TXTDM );
72
- (isset($member_lastname) && $member_lastname) ? $new_team[$i]['_tmm_lastname'] = stripslashes( wp_kses_post( $member_lastname ) ) : $new_team[$i]['_tmm_lastname'] = '';
73
- (isset($member_job) && $member_job) ? $new_team[$i]['_tmm_job'] = stripslashes( wp_kses_post( $member_job ) ) : $new_team[$i]['_tmm_job'] = '';
74
- (isset($member_bio) && $member_bio) ? $new_team[$i]['_tmm_desc'] = wp_kses_post(balanceTags( $member_bio )) : $new_team[$i]['_tmm_desc'] = '';
75
- (isset($member_photo) && $member_photo) ? $new_team[$i]['_tmm_photo'] = stripslashes( strip_tags( sanitize_text_field( $member_photo ) ) ) : $new_team[$i]['_tmm_photo'] = '';
76
- (isset($member_photo_url) && $member_photo_url) ? $new_team[$i]['_tmm_photo_url'] = stripslashes( strip_tags( sanitize_text_field( $member_photo_url ) ) ) : $new_team[$i]['_tmm_photo_url'] = '';
77
-
78
- (isset($member_scl_type1) && $member_scl_type1) ? $new_team[$i]['_tmm_sc_type1'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_type1 ) ) ) : $new_team[$i]['_tmm_sc_type1'] = '';
79
- (isset($member_scl_title1) && $member_scl_title1) ? $new_team[$i]['_tmm_sc_title1'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_title1 ) ) ) : $new_team[$i]['_tmm_sc_title1'] = '';
80
- (isset($member_scl_url1) && $member_scl_url1) ? $new_team[$i]['_tmm_sc_url1'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_url1 ) ) ) : $new_team[$i]['_tmm_sc_url1'] = '';
81
-
82
- (isset($member_scl_type2) && $member_scl_type2) ? $new_team[$i]['_tmm_sc_type2'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_type2 ) ) ) : $new_team[$i]['_tmm_sc_type2'] = '';
83
- (isset($member_scl_title2) && $member_scl_title2) ? $new_team[$i]['_tmm_sc_title2'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_title2 ) ) ) : $new_team[$i]['_tmm_sc_title2'] = '';
84
- (isset($member_scl_url2) && $member_scl_url2) ? $new_team[$i]['_tmm_sc_url2'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_url2 ) ) ) : $new_team[$i]['_tmm_sc_url2'] = '';
85
-
86
- (isset($member_scl_type3) && $member_scl_type3) ? $new_team[$i]['_tmm_sc_type3'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_type3 ) ) ) : $new_team[$i]['_tmm_sc_type3'] = '';
87
- (isset($member_scl_title3) && $member_scl_title3) ? $new_team[$i]['_tmm_sc_title3'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_title3 ) ) ) : $new_team[$i]['_tmm_sc_title3'] = '';
88
- (isset($member_scl_url3) && $member_scl_url3) ? $new_team[$i]['_tmm_sc_url3'] = stripslashes( strip_tags( sanitize_text_field( $member_scl_url3 ) ) ) : $new_team[$i]['_tmm_sc_url3'] = '';
89
-
90
  }
91
-
92
  }
93
-
94
  }
95
 
96
- /* Settings. */
97
- (isset($_POST['team_color']) && $_POST['team_color']) ? $new_team_settings['_tmm_color'] = stripslashes( strip_tags( sanitize_text_field( $_POST['team_color'] ) ) ) : $new_team_settings['_tmm_color'] = '';
98
- (isset($_POST['team_columns']) && $_POST['team_columns']) ? $new_team_settings['_tmm_columns'] = stripslashes( strip_tags( sanitize_text_field( $_POST['team_columns'] ) ) ) : $new_team_settings['_tmm_columns'] = '';
99
- (isset($_POST['team_bio_align']) && $_POST['team_bio_align']) ? $new_team_settings['_tmm_bio_alignment'] = stripslashes( strip_tags( sanitize_text_field( $_POST['team_bio_align'] ) ) ) : $new_team_settings['_tmm_bio_alignment'] = '';
100
- (isset($_POST['team_force_font']) && $_POST['team_force_font']) ? $new_team_settings['_tmm_original_font'] = stripslashes( strip_tags( sanitize_text_field( $_POST['team_force_font'] ) ) ) : $new_team_settings['_tmm_original_font'] = '';
101
- (isset($_POST['team_piclink_beh']) && $_POST['team_piclink_beh']) ? $new_team_settings['_tmm_piclink_beh'] = stripslashes( strip_tags( sanitize_text_field( $_POST['team_piclink_beh'] ) ) ) : $new_team_settings['_tmm_piclink_beh'] = '';
102
 
103
  /* Updates plans. */
104
- if ( !empty( $new_team ) && $new_team != $old_team )
105
- update_post_meta( $post_id, '_tmm_head', $new_team );
106
- elseif ( empty($new_team) && $old_team )
107
- delete_post_meta( $post_id, '_tmm_head', $old_team );
108
-
109
- if ( !empty( $new_team_settings['_tmm_color'] ) && $new_team_settings['_tmm_color'] != $old_team_settings['_tmm_color'] )
110
- update_post_meta( $post_id, '_tmm_color', $new_team_settings['_tmm_color'] );
111
 
112
- if ( !empty( $new_team_settings['_tmm_columns'] ) && $new_team_settings['_tmm_columns'] != $old_team_settings['_tmm_columns'] )
113
- update_post_meta( $post_id, '_tmm_columns', $new_team_settings['_tmm_columns'] );
114
 
115
- if ( !empty( $new_team_settings['_tmm_bio_alignment'] ) && $new_team_settings['_tmm_bio_alignment'] != $old_team_settings['_tmm_bio_alignment'] )
116
- update_post_meta( $post_id, '_tmm_bio_alignment', $new_team_settings['_tmm_bio_alignment'] );
117
 
118
- if ( !empty( $new_team_settings['_tmm_original_font'] ) && $new_team_settings['_tmm_original_font'] != $old_team_settings['_tmm_original_font'] )
119
- update_post_meta( $post_id, '_tmm_original_font', $new_team_settings['_tmm_original_font'] );
120
 
121
- if ( !empty( $new_team_settings['_tmm_piclink_beh'] ) && $new_team_settings['_tmm_piclink_beh'] != $old_team_settings['_tmm_piclink_beh'] )
122
- update_post_meta( $post_id, '_tmm_piclink_beh', $new_team_settings['_tmm_piclink_beh'] );
123
 
 
 
124
  }
1
+ <?php
2
 
3
  /* Saves metaboxes. */
4
  add_action('save_post', 'dmb_tmm_plan_meta_box_save');
5
+ function dmb_tmm_plan_meta_box_save($post_id)
6
+ {
7
 
8
+ if (
9
+ !isset($_POST['dmb_tmm_meta_box_nonce']) ||
10
+ !wp_verify_nonce(sanitize_key($_POST['dmb_tmm_meta_box_nonce']), 'dmb_tmm_meta_box_nonce')
11
+ )
12
  return;
13
 
14
  if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
17
  if (!current_user_can('edit_post', $post_id))
18
  return;
19
 
20
+ if (!isset($_POST['tmm_data_dumps'])) {
21
+ return;
22
+ }
23
+
24
  /* Gets members. */
25
  $old_team = get_post_meta($post_id, '_tmm_head', true);
26
 
30
  /* Settings. */
31
  $old_team_settings = array();
32
 
33
+ $old_team_settings['_tmm_columns'] = get_post_meta($post_id, '_tmm_columns', true);
34
+ $old_team_settings['_tmm_color'] = get_post_meta($post_id, '_tmm_color', true);
35
+ $old_team_settings['_tmm_bio_alignment'] = get_post_meta($post_id, '_tmm_bio_alignment', true);
36
+ $old_team_settings['_tmm_piclink_beh'] = get_post_meta($post_id, '_tmm_piclink_beh', true);
37
+ $old_team_settings['_tmm_original_font'] = get_post_meta($post_id, '_tmm_original_font', true);
38
+
39
+ $tmm_data_dumps = array_map('wp_kses_post', wp_unslash($_POST['tmm_data_dumps'])); // sanitize array
40
 
41
+ $count = count($tmm_data_dumps) - 1;
42
 
43
+ for ($i = 0; $i < $count; $i++) {
44
 
45
+ if ($tmm_data_dumps[$i]) {
46
+
47
+ /* Data travels using a single field to avoid max_input_vars issue. */
48
+ $member_data = explode(']--[', $tmm_data_dumps[$i]);
49
 
 
 
 
50
  $member_firstname = $member_data[0];
51
  $member_lastname = $member_data[1];
52
  $member_job = $member_data[2];
53
  $member_bio = $member_data[3];
54
+
55
  $member_scl_type1 = $member_data[4];
56
  $member_scl_title1 = $member_data[5];
57
  $member_scl_url1 = $member_data[6];
58
+
59
  $member_scl_type2 = $member_data[7];
60
  $member_scl_title2 = $member_data[8];
61
  $member_scl_url2 = $member_data[9];
62
+
63
  $member_scl_type3 = $member_data[10];
64
  $member_scl_title3 = $member_data[11];
65
  $member_scl_url3 = $member_data[12];
66
+
67
  $member_photo = $member_data[13];
68
  $member_photo_url = $member_data[14];
69
 
70
+ /* Saves the member if at least one of these fields are not empty. */
71
+ if (
72
  $member_firstname != ''
73
+ || $member_lastname != ''
74
  || $member_job != ''
75
  || $member_bio != ''
76
  || $member_photo != ''
77
  ) {
78
+
79
  /* Head. */
80
+ (isset($member_firstname) && $member_firstname) ? $new_team[$i]['_tmm_firstname'] = stripslashes(wp_kses_post($member_firstname)) : $new_team[$i]['_tmm_firstname'] = __('Untitled', TMM_TXTDM);
81
+ (isset($member_lastname) && $member_lastname) ? $new_team[$i]['_tmm_lastname'] = stripslashes(wp_kses_post($member_lastname)) : $new_team[$i]['_tmm_lastname'] = '';
82
+ (isset($member_job) && $member_job) ? $new_team[$i]['_tmm_job'] = stripslashes(wp_kses_post($member_job)) : $new_team[$i]['_tmm_job'] = '';
83
+ (isset($member_bio) && $member_bio) ? $new_team[$i]['_tmm_desc'] = wp_kses_post(balanceTags($member_bio)) : $new_team[$i]['_tmm_desc'] = '';
84
+ (isset($member_photo) && $member_photo) ? $new_team[$i]['_tmm_photo'] = stripslashes(strip_tags(sanitize_text_field($member_photo))) : $new_team[$i]['_tmm_photo'] = '';
85
+ (isset($member_photo_url) && $member_photo_url) ? $new_team[$i]['_tmm_photo_url'] = stripslashes(strip_tags(sanitize_text_field($member_photo_url))) : $new_team[$i]['_tmm_photo_url'] = '';
86
+
87
+ (isset($member_scl_type1) && $member_scl_type1) ? $new_team[$i]['_tmm_sc_type1'] = stripslashes(strip_tags(sanitize_text_field($member_scl_type1))) : $new_team[$i]['_tmm_sc_type1'] = '';
88
+ (isset($member_scl_title1) && $member_scl_title1) ? $new_team[$i]['_tmm_sc_title1'] = stripslashes(strip_tags(sanitize_text_field($member_scl_title1))) : $new_team[$i]['_tmm_sc_title1'] = '';
89
+ (isset($member_scl_url1) && $member_scl_url1) ? $new_team[$i]['_tmm_sc_url1'] = stripslashes(strip_tags(sanitize_text_field($member_scl_url1))) : $new_team[$i]['_tmm_sc_url1'] = '';
90
+
91
+ (isset($member_scl_type2) && $member_scl_type2) ? $new_team[$i]['_tmm_sc_type2'] = stripslashes(strip_tags(sanitize_text_field($member_scl_type2))) : $new_team[$i]['_tmm_sc_type2'] = '';
92
+ (isset($member_scl_title2) && $member_scl_title2) ? $new_team[$i]['_tmm_sc_title2'] = stripslashes(strip_tags(sanitize_text_field($member_scl_title2))) : $new_team[$i]['_tmm_sc_title2'] = '';
93
+ (isset($member_scl_url2) && $member_scl_url2) ? $new_team[$i]['_tmm_sc_url2'] = stripslashes(strip_tags(sanitize_text_field($member_scl_url2))) : $new_team[$i]['_tmm_sc_url2'] = '';
94
+
95
+ (isset($member_scl_type3) && $member_scl_type3) ? $new_team[$i]['_tmm_sc_type3'] = stripslashes(strip_tags(sanitize_text_field($member_scl_type3))) : $new_team[$i]['_tmm_sc_type3'] = '';
96
+ (isset($member_scl_title3) && $member_scl_title3) ? $new_team[$i]['_tmm_sc_title3'] = stripslashes(strip_tags(sanitize_text_field($member_scl_title3))) : $new_team[$i]['_tmm_sc_title3'] = '';
97
+ (isset($member_scl_url3) && $member_scl_url3) ? $new_team[$i]['_tmm_sc_url3'] = stripslashes(strip_tags(sanitize_text_field($member_scl_url3))) : $new_team[$i]['_tmm_sc_url3'] = '';
 
98
  }
 
99
  }
 
100
  }
101
 
102
+ /* Settings. */
103
+ (isset($_POST['team_color']) && sanitize_text_field(wp_unslash($_POST['team_color']))) ? $new_team_settings['_tmm_color'] = stripslashes(strip_tags(sanitize_text_field(wp_unslash($_POST['team_color'])))) : $new_team_settings['_tmm_color'] = '';
104
+ (isset($_POST['team_columns']) && sanitize_text_field(wp_unslash($_POST['team_columns']))) ? $new_team_settings['_tmm_columns'] = stripslashes(strip_tags(sanitize_text_field(wp_unslash($_POST['team_columns'])))) : $new_team_settings['_tmm_columns'] = '';
105
+ (isset($_POST['team_bio_align']) && sanitize_text_field(wp_unslash($_POST['team_bio_align']))) ? $new_team_settings['_tmm_bio_alignment'] = stripslashes(strip_tags(sanitize_text_field(wp_unslash($_POST['team_bio_align'])))) : $new_team_settings['_tmm_bio_alignment'] = '';
106
+ (isset($_POST['team_force_font']) && sanitize_text_field(wp_unslash($_POST['team_force_font']))) ? $new_team_settings['_tmm_original_font'] = stripslashes(strip_tags(sanitize_text_field(wp_unslash($_POST['team_force_font'])))) : $new_team_settings['_tmm_original_font'] = '';
107
+ (isset($_POST['team_piclink_beh']) && sanitize_text_field(wp_unslash($_POST['team_piclink_beh']))) ? $new_team_settings['_tmm_piclink_beh'] = stripslashes(strip_tags(sanitize_text_field(wp_unslash($_POST['team_piclink_beh'])))) : $new_team_settings['_tmm_piclink_beh'] = '';
108
 
109
  /* Updates plans. */
110
+ if (!empty($new_team) && $new_team != $old_team)
111
+ update_post_meta($post_id, '_tmm_head', $new_team);
112
+ elseif (empty($new_team) && $old_team)
113
+ delete_post_meta($post_id, '_tmm_head', $old_team);
 
 
 
114
 
115
+ if (!empty($new_team_settings['_tmm_color']) && $new_team_settings['_tmm_color'] != $old_team_settings['_tmm_color'])
116
+ update_post_meta($post_id, '_tmm_color', $new_team_settings['_tmm_color']);
117
 
118
+ if (!empty($new_team_settings['_tmm_columns']) && $new_team_settings['_tmm_columns'] != $old_team_settings['_tmm_columns'])
119
+ update_post_meta($post_id, '_tmm_columns', $new_team_settings['_tmm_columns']);
120
 
121
+ if (!empty($new_team_settings['_tmm_bio_alignment']) && $new_team_settings['_tmm_bio_alignment'] != $old_team_settings['_tmm_bio_alignment'])
122
+ update_post_meta($post_id, '_tmm_bio_alignment', $new_team_settings['_tmm_bio_alignment']);
123
 
124
+ if (!empty($new_team_settings['_tmm_original_font']) && $new_team_settings['_tmm_original_font'] != $old_team_settings['_tmm_original_font'])
125
+ update_post_meta($post_id, '_tmm_original_font', $new_team_settings['_tmm_original_font']);
126
 
127
+ if (!empty($new_team_settings['_tmm_piclink_beh']) && $new_team_settings['_tmm_piclink_beh'] != $old_team_settings['_tmm_piclink_beh'])
128
+ update_post_meta($post_id, '_tmm_piclink_beh', $new_team_settings['_tmm_piclink_beh']);
129
  }
inc/tmm-shortcode-column.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
 
3
  /* Handles shortcode column display. */
4
- add_action( 'manage_tmm_posts_custom_column' , 'tmm_custom_columns', 10, 2 );
5
- function tmm_custom_columns( $column, $post_id ) {
6
- switch ( $column ) {
7
- case 'dk_shortcode' :
 
8
  global $post;
9
- $slug = '' ;
10
  $slug = $post->post_name;
11
- $shortcode = '<span style="display:inline-block;border:solid 2px lightgray; background:white; padding:0 8px; font-size:13px; line-height:25px; vertical-align:middle;">[tmm name="'.$slug.'"]</span>';
12
- echo $shortcode;
13
  break;
14
  }
15
  }
16
 
17
 
18
  /* Adds the shortcode column in admin. */
19
- add_filter( 'manage_tmm_posts_columns' , 'add_tmm_columns' );
20
- function add_tmm_columns( $columns ) {
21
- return array_merge( $columns, array('dk_shortcode' => 'Shortcode') );
22
- }
23
-
24
- ?>
1
+ <?php
2
 
3
  /* Handles shortcode column display. */
4
+ add_action('manage_tmm_posts_custom_column', 'tmm_custom_columns', 10, 2);
5
+ function tmm_custom_columns($column, $post_id)
6
+ {
7
+ switch ($column) {
8
+ case 'dk_shortcode':
9
  global $post;
10
+ $slug = '';
11
  $slug = $post->post_name;
12
+ $shortcode = '<span style="display:inline-block;border:solid 2px lightgray; background:white; padding:0 8px; font-size:13px; line-height:25px; vertical-align:middle;">[tmm name="' . $slug . '"]</span>';
13
+ echo wp_kses_post($shortcode);
14
  break;
15
  }
16
  }
17
 
18
 
19
  /* Adds the shortcode column in admin. */
20
+ add_filter('manage_tmm_posts_columns', 'add_tmm_columns');
21
+ function add_tmm_columns($columns)
22
+ {
23
+ return array_merge($columns, array('dk_shortcode' => 'Shortcode'));
24
+ }
 
inc/tmm-shortcode.php CHANGED
@@ -1,121 +1,123 @@
1
- <?php
2
 
3
  /* Handles team shortcodes. */
4
  add_shortcode("tmm", "tmm_sc");
5
- function tmm_sc($atts) {
 
6
 
7
  global $post;
8
 
9
  /* Gets table slug (post name). */
10
- $all_attr = shortcode_atts( array( "name" => '' ), $atts );
11
  $name = $all_attr['name'];
12
 
13
  /* Gets the team. */
14
  $args = array('post_type' => 'tmm', 'name' => $name);
15
  $custom_posts = get_posts($args);
16
 
17
- foreach($custom_posts as $post) : setup_postdata($post);
18
 
19
- $members = get_post_meta( get_the_id(), '_tmm_head', true );
20
- $tmm_columns = get_post_meta( $post->ID, '_tmm_columns', true );
21
- $tmm_color = get_post_meta( $post->ID, '_tmm_color', true );
22
- $tmm_bio_alignment = get_post_meta( $post->ID, '_tmm_bio_alignment', true );
23
 
24
  /* Checks if member links open in new window. */
25
- $tmm_piclink_beh = get_post_meta( $post->ID, '_tmm_piclink_beh', true );
26
  ($tmm_piclink_beh == 'new' ? $tmm_plb = 'target="_blank"' : $tmm_plb = '');
27
 
28
  /* Checks if forcing original fonts. */
29
- $original_font = get_post_meta( $post->ID, '_tmm_original_font', true );
30
  if ($original_font) {
31
- if ($original_font == "no") { $ori_f = 'tmm_theme_f'; }
32
- else if ($original_font == "yes") { $ori_f = 'tmm_plugin_f'; }
 
 
 
33
  } else {
34
  $ori_f = 'tmm_plugin_f';
35
  }
36
 
37
  $team_view = '';
38
- $team_view .= '<div class="tmm tmm_'.$name.'">';
39
- $team_view .= '<div class="tmm_'.$tmm_columns.'_columns tmm_wrap '.$ori_f.'">';
40
-
41
- if (is_array($members) || is_object($members)) {
42
- foreach ($members as $key => $member) {
43
-
44
- /* Creates Team container. */
45
- if($key%2 == 0) {
46
- /* Checks if group of two (alignment). */
47
- $team_view .= '<span class="tmm_two_containers_tablet"></span>';
48
- }
49
- if($key%$tmm_columns == 0) {
50
- /* Checks if first div of group and closes. */
51
- if($key > 0) $team_view .= '</div><span class="tmm_columns_containers_desktop"></span>';
52
- $team_view .= '<div class="tmm_container">';
53
- }
54
 
55
- /* START member. */
56
- $team_view .= '<div class="tmm_member" style="border-top:'.$tmm_color.' solid 5px;">';
57
-
58
- /* Displays member photo. */
59
- if (!empty($member['_tmm_photo_url']))
60
- $team_view .= '<a '.$tmm_plb.' href="'.$member['_tmm_photo_url'].'" title="'.$member['_tmm_firstname'].' '.$member['_tmm_lastname'].'">';
61
-
62
- if (!empty($member['_tmm_photo']))
63
- $team_view .= '<div class="tmm_photo tmm_pic_'.$name.'_'.$key.'" style="background: url('.$member['_tmm_photo'].'); margin-left: auto; margin-right:auto; background-size:cover !important;"></div>';
64
-
65
- if (!empty($member['_tmm_photo_url']))
66
- $team_view .= '</a>';
67
-
68
- /* Creates text block. */
69
- $team_view .= '<div class="tmm_textblock">';
70
-
71
- /* Displays names. */
72
- $team_view .= '<div class="tmm_names">';
73
- if (!empty($member['_tmm_firstname']))
74
- $team_view .= '<span class="tmm_fname">'.$member['_tmm_firstname'].'</span> ';
75
- if (!empty($member['_tmm_lastname']))
76
- $team_view .= '<span class="tmm_lname">'.$member['_tmm_lastname'].'</span>';
77
- $team_view .= '</div>';
78
-
79
- /* Displays jobs. */
80
- if (!empty($member['_tmm_job']))
81
- $team_view .= '<div class="tmm_job">'.$member['_tmm_job'].'</div>';
82
-
83
- /* Displays bios. */
84
- if (!empty($member['_tmm_desc']))
85
- $team_view .= '<div class="tmm_desc" style="text-align:'.$tmm_bio_alignment.'">'.do_shortcode($member['_tmm_desc']).'</div>';
86
-
87
- /* Creates social block. */
88
- $team_view .= '<div class="tmm_scblock">';
89
-
90
- /* Displays social links. */
91
- for ($i = 1; $i <= 3; $i++) {
92
- if ($member['_tmm_sc_type'.$i] != 'nada') {
93
- if ($member['_tmm_sc_type'.$i] == 'email') {
94
- $team_view .= '<a class="tmm_sociallink" href="mailto:'.(!empty($member['_tmm_sc_url'.$i])?$member['_tmm_sc_url'.$i]:'').'" title="'.(!empty($member['_tmm_sc_title'.$i])?$member['_tmm_sc_title'.$i]:'').'"><img alt="'.(!empty($member['_tmm_sc_title'.$i])?$member['_tmm_sc_title'.$i]:'').'" src="'.plugins_url('img/links/', __FILE__).$member['_tmm_sc_type'.$i].'.png"/></a>';
95
- } else if ($member['_tmm_sc_type'.$i] == 'phone') {
96
- $team_view .= '<a class="tmm_sociallink" href="tel:'.(!empty($member['_tmm_sc_url'.$i])?$member['_tmm_sc_url'.$i]:'').'" title="'.(!empty($member['_tmm_sc_title'.$i])?$member['_tmm_sc_title'.$i]:'').'"><img alt="'.(!empty($member['_tmm_sc_title'.$i])?$member['_tmm_sc_title'.$i]:'').'" src="'.plugins_url('img/links/', __FILE__).$member['_tmm_sc_type'.$i].'.png"/></a>';
97
- } else {
98
- $team_view .= '<a target="_blank" class="tmm_sociallink" href="'.(!empty($member['_tmm_sc_url'.$i])?$member['_tmm_sc_url'.$i]:'').'" title="'.(!empty($member['_tmm_sc_title'.$i])?$member['_tmm_sc_title'.$i]:'').'"><img alt="'.(!empty($member['_tmm_sc_title'.$i])?$member['_tmm_sc_title'.$i]:'').'" src="'.plugins_url('img/links/', __FILE__).$member['_tmm_sc_type'.$i].'.png"/></a>';
99
- }
100
- }
101
- }
102
-
103
- $team_view .= '</div>'; // Closes social block.
104
- $team_view .= '</div>'; // Closes text block.
105
- $team_view .= '</div>'; // END member.
106
-
107
- $page_count = count( $members );
108
- if ($key == $page_count - 1) $team_view .= '<div style="clear:both;"></div>';
109
  }
110
  }
111
 
112
- $team_view .= '</div>'; // Closes container.
113
- $team_view .= '</div>'; // Closes wrap.
 
 
 
 
 
 
 
 
 
114
  $team_view .= '</div>'; // Closes tmm.
115
 
116
- endforeach; wp_reset_postdata();
 
117
  return $team_view;
118
-
119
- }
120
-
121
- ?>
1
+ <?php
2
 
3
  /* Handles team shortcodes. */
4
  add_shortcode("tmm", "tmm_sc");
5
+ function tmm_sc($atts)
6
+ {
7
 
8
  global $post;
9
 
10
  /* Gets table slug (post name). */
11
+ $all_attr = shortcode_atts(array("name" => ''), $atts);
12
  $name = $all_attr['name'];
13
 
14
  /* Gets the team. */
15
  $args = array('post_type' => 'tmm', 'name' => $name);
16
  $custom_posts = get_posts($args);
17
 
18
+ foreach ($custom_posts as $post) : setup_postdata($post);
19
 
20
+ $members = get_post_meta(get_the_id(), '_tmm_head', true);
21
+ $tmm_columns = get_post_meta($post->ID, '_tmm_columns', true);
22
+ $tmm_color = get_post_meta($post->ID, '_tmm_color', true);
23
+ $tmm_bio_alignment = get_post_meta($post->ID, '_tmm_bio_alignment', true);
24
 
25
  /* Checks if member links open in new window. */
26
+ $tmm_piclink_beh = get_post_meta($post->ID, '_tmm_piclink_beh', true);
27
  ($tmm_piclink_beh == 'new' ? $tmm_plb = 'target="_blank"' : $tmm_plb = '');
28
 
29
  /* Checks if forcing original fonts. */
30
+ $original_font = get_post_meta($post->ID, '_tmm_original_font', true);
31
  if ($original_font) {
32
+ if ($original_font == "no") {
33
+ $ori_f = 'tmm_theme_f';
34
+ } else if ($original_font == "yes") {
35
+ $ori_f = 'tmm_plugin_f';
36
+ }
37
  } else {
38
  $ori_f = 'tmm_plugin_f';
39
  }
40
 
41
  $team_view = '';
42
+ $team_view .= '<div class="tmm tmm_' . $name . '">';
43
+ $team_view .= '<div class="tmm_' . $tmm_columns . '_columns tmm_wrap ' . $ori_f . '">';
44
+
45
+ if (is_array($members) || is_object($members)) {
46
+ foreach ($members as $key => $member) {
47
+
48
+ /* Creates Team container. */
49
+ if ($key % 2 == 0) {
50
+ /* Checks if group of two (alignment). */
51
+ $team_view .= '<span class="tmm_two_containers_tablet"></span>';
52
+ }
53
+ if ($key % $tmm_columns == 0) {
54
+ /* Checks if first div of group and closes. */
55
+ if ($key > 0) $team_view .= '</div><span class="tmm_columns_containers_desktop"></span>';
56
+ $team_view .= '<div class="tmm_container">';
57
+ }
58
 
59
+ /* START member. */
60
+ $team_view .= '<div class="tmm_member" style="border-top:' . $tmm_color . ' solid 5px;">';
61
+
62
+ /* Displays member photo. */
63
+ if (!empty($member['_tmm_photo_url']))
64
+ $team_view .= '<a ' . $tmm_plb . ' href="' . $member['_tmm_photo_url'] . '" title="' . $member['_tmm_firstname'] . ' ' . $member['_tmm_lastname'] . '">';
65
+
66
+ if (!empty($member['_tmm_photo']))
67
+ $team_view .= '<div class="tmm_photo tmm_pic_' . $name . '_' . $key . '" style="background: url(' . $member['_tmm_photo'] . '); margin-left: auto; margin-right:auto; background-size:cover !important;"></div>';
68
+
69
+ if (!empty($member['_tmm_photo_url']))
70
+ $team_view .= '</a>';
71
+
72
+ /* Creates text block. */
73
+ $team_view .= '<div class="tmm_textblock">';
74
+
75
+ /* Displays names. */
76
+ $team_view .= '<div class="tmm_names">';
77
+ if (!empty($member['_tmm_firstname']))
78
+ $team_view .= '<span class="tmm_fname">' . $member['_tmm_firstname'] . '</span> ';
79
+ if (!empty($member['_tmm_lastname']))
80
+ $team_view .= '<span class="tmm_lname">' . $member['_tmm_lastname'] . '</span>';
81
+ $team_view .= '</div>';
82
+
83
+ /* Displays jobs. */
84
+ if (!empty($member['_tmm_job']))
85
+ $team_view .= '<div class="tmm_job">' . $member['_tmm_job'] . '</div>';
86
+
87
+ /* Displays bios. */
88
+ if (!empty($member['_tmm_desc']))
89
+ $team_view .= '<div class="tmm_desc" style="text-align:' . $tmm_bio_alignment . '">' . do_shortcode($member['_tmm_desc']) . '</div>';
90
+
91
+ /* Creates social block. */
92
+ $team_view .= '<div class="tmm_scblock">';
93
+
94
+ /* Displays social links. */
95
+ for ($i = 1; $i <= 3; $i++) {
96
+ if ($member['_tmm_sc_type' . $i] != 'nada') {
97
+ if ($member['_tmm_sc_type' . $i] == 'email') {
98
+ $team_view .= '<a class="tmm_sociallink" href="mailto:' . (!empty($member['_tmm_sc_url' . $i]) ? $member['_tmm_sc_url' . $i] : '') . '" title="' . (!empty($member['_tmm_sc_title' . $i]) ? $member['_tmm_sc_title' . $i] : '') . '"><img alt="' . (!empty($member['_tmm_sc_title' . $i]) ? $member['_tmm_sc_title' . $i] : '') . '" src="' . plugins_url('img/links/', __FILE__) . $member['_tmm_sc_type' . $i] . '.png"/></a>';
99
+ } else if ($member['_tmm_sc_type' . $i] == 'phone') {
100
+ $team_view .= '<a class="tmm_sociallink" href="tel:' . (!empty($member['_tmm_sc_url' . $i]) ? $member['_tmm_sc_url' . $i] : '') . '" title="' . (!empty($member['_tmm_sc_title' . $i]) ? $member['_tmm_sc_title' . $i] : '') . '"><img alt="' . (!empty($member['_tmm_sc_title' . $i]) ? $member['_tmm_sc_title' . $i] : '') . '" src="' . plugins_url('img/links/', __FILE__) . $member['_tmm_sc_type' . $i] . '.png"/></a>';
101
+ } else {
102
+ $team_view .= '<a target="_blank" class="tmm_sociallink" href="' . (!empty($member['_tmm_sc_url' . $i]) ? $member['_tmm_sc_url' . $i] : '') . '" title="' . (!empty($member['_tmm_sc_title' . $i]) ? $member['_tmm_sc_title' . $i] : '') . '"><img alt="' . (!empty($member['_tmm_sc_title' . $i]) ? $member['_tmm_sc_title' . $i] : '') . '" src="' . plugins_url('img/links/', __FILE__) . $member['_tmm_sc_type' . $i] . '.png"/></a>';
103
+ }
 
 
 
 
 
 
 
 
 
104
  }
105
  }
106
 
107
+ $team_view .= '</div>'; // Closes social block.
108
+ $team_view .= '</div>'; // Closes text block.
109
+ $team_view .= '</div>'; // END member.
110
+
111
+ $page_count = count($members);
112
+ if ($key == $page_count - 1) $team_view .= '<div style="clear:both;"></div>';
113
+ }
114
+ }
115
+
116
+ $team_view .= '</div>'; // Closes container.
117
+ $team_view .= '</div>'; // Closes wrap.
118
  $team_view .= '</div>'; // Closes tmm.
119
 
120
+ endforeach;
121
+ wp_reset_postdata();
122
  return $team_view;
123
+ }
 
 
 
inc/tmm-text-domain.php CHANGED
@@ -4,6 +4,4 @@
4
  add_action( 'plugins_loaded', 'tmm_load_plugin_textdomain' );
5
  function tmm_load_plugin_textdomain() {
6
  load_plugin_textdomain( TMM_TXTDM, FALSE, TMM_PATH . 'lang/' );
7
- }
8
-
9
- ?>
4
  add_action( 'plugins_loaded', 'tmm_load_plugin_textdomain' );
5
  function tmm_load_plugin_textdomain() {
6
  load_plugin_textdomain( TMM_TXTDM, FALSE, TMM_PATH . 'lang/' );
7
+ }
 
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: spwebguy
3
  Tags: team, teams, meet the team, shortcode, responsive, members, staff, people
4
  Requires at least: 3.6
5
- Tested up to: 5.7
6
  Stable tag: trunk
7
  License: GPL2
8
  License URI: http://www.gnu.org/licenses/gpl.html
@@ -93,6 +93,13 @@ Find help on [our support platform](https://wpdarko.com/support) for this plugin
93
  6. Finding the shortcode (admin view)
94
 
95
  == Changelog ==
 
 
 
 
 
 
 
96
  = 5.0.10 =
97
  * Fixed phone link issue
98
 
2
  Contributors: spwebguy
3
  Tags: team, teams, meet the team, shortcode, responsive, members, staff, people
4
  Requires at least: 3.6
5
+ Tested up to: 5.9
6
  Stable tag: trunk
7
  License: GPL2
8
  License URI: http://www.gnu.org/licenses/gpl.html
93
  6. Finding the shortcode (admin view)
94
 
95
  == Changelog ==
96
+ = 5.1.1 =
97
+ * Security update
98
+
99
+ = 5.1.0 =
100
+ * Fixed photo styling issue
101
+ * Better handling of rounded photos
102
+
103
  = 5.0.10 =
104
  * Fixed phone link issue
105
 
tmm.php CHANGED
@@ -1,9 +1,10 @@
1
  <?php
 
2
  /**
3
  * Plugin Name: Team Members
4
  * Plugin URI: https://wpdarko.com/team-members
5
  * Description: A responsive, simple and clean way to display your team. Create new members, add their positions, bios, social links and copy-paste the shortcode into any post/page. Find help and information on our <a href="https://wpdarko.com/support">support site</a>. This free version is NOT limited and does not contain any ad. Check out the <a href='https://wpdarko.com/team-members'>PRO version</a> for more great features.
6
- * Version: 5.0.10
7
  * Author: WP Darko
8
  * Author URI: https://wpdarko.com
9
  * Text Domain: team-members
@@ -12,40 +13,31 @@
12
  */
13
 
14
  /* Defines plugin's root folder. */
15
- define( 'TMM_PATH', plugin_dir_path( __FILE__ ) );
16
-
17
 
18
  /* Defines plugin's text domain. */
19
- define( 'TMM_TXTDM', 'team-members' );
20
-
21
 
22
  /* General. */
23
  require_once('inc/tmm-text-domain.php');
24
  require_once('inc/tmm-pro-version-check.php');
25
 
26
-
27
  /* Scripts. */
28
  require_once('inc/tmm-front-scripts.php');
29
  require_once('inc/tmm-admin-scripts.php');
30
 
31
-
32
  /* Teams. */
33
  require_once('inc/tmm-post-type.php');
34
 
35
-
36
  /* Shortcode. */
37
  require_once('inc/tmm-shortcode-column.php');
38
  require_once('inc/tmm-shortcode.php');
39
 
40
-
41
  /* Registers metaboxes. */
42
  require_once('inc/tmm-metaboxes-members.php');
43
  require_once('inc/tmm-metaboxes-settings.php');
44
  require_once('inc/tmm-metaboxes-help.php');
45
  require_once('inc/tmm-metaboxes-pro.php');
46
 
47
-
48
  /* Saves metaboxes. */
49
- require_once('inc/tmm-save-metaboxes.php');
50
-
51
- ?>
1
  <?php
2
+
3
  /**
4
  * Plugin Name: Team Members
5
  * Plugin URI: https://wpdarko.com/team-members
6
  * Description: A responsive, simple and clean way to display your team. Create new members, add their positions, bios, social links and copy-paste the shortcode into any post/page. Find help and information on our <a href="https://wpdarko.com/support">support site</a>. This free version is NOT limited and does not contain any ad. Check out the <a href='https://wpdarko.com/team-members'>PRO version</a> for more great features.
7
+ * Version: 5.1.1
8
  * Author: WP Darko
9
  * Author URI: https://wpdarko.com
10
  * Text Domain: team-members
13
  */
14
 
15
  /* Defines plugin's root folder. */
16
+ define('TMM_PATH', plugin_dir_path(__FILE__));
 
17
 
18
  /* Defines plugin's text domain. */
19
+ define('TMM_TXTDM', 'team-members');
 
20
 
21
  /* General. */
22
  require_once('inc/tmm-text-domain.php');
23
  require_once('inc/tmm-pro-version-check.php');
24
 
 
25
  /* Scripts. */
26
  require_once('inc/tmm-front-scripts.php');
27
  require_once('inc/tmm-admin-scripts.php');
28
 
 
29
  /* Teams. */
30
  require_once('inc/tmm-post-type.php');
31
 
 
32
  /* Shortcode. */
33
  require_once('inc/tmm-shortcode-column.php');
34
  require_once('inc/tmm-shortcode.php');
35
 
 
36
  /* Registers metaboxes. */
37
  require_once('inc/tmm-metaboxes-members.php');
38
  require_once('inc/tmm-metaboxes-settings.php');
39
  require_once('inc/tmm-metaboxes-help.php');
40
  require_once('inc/tmm-metaboxes-pro.php');
41
 
 
42
  /* Saves metaboxes. */
43
+ require_once('inc/tmm-save-metaboxes.php');