Version Description
- Patch plugin code to be backwards compatible with older PHP versions
- Added the ability to display multiple groups in one shortcode
- New members now are added last
Download this release
Release Info
Developer | smartcat |
Plugin | Our Team Showcase |
Version | 4.0.1 |
Comparing to | |
See all releases |
Code changes from version 4.0.0 to 4.0.1
- constants.php +2 -2
- includes/TeamMember.php +5 -1
- includes/functions.php +23 -9
- includes/team-view.php +8 -2
- includes/team_member-post-type.php +1 -1
- our-team-showcase.php +3 -3
- readme.txt +6 -1
constants.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
namespace ots;
|
4 |
|
5 |
-
const VERSION = '4.0.
|
6 |
|
7 |
|
8 |
interface Options {
|
@@ -129,7 +129,7 @@ interface Defaults {
|
|
129 |
/**
|
130 |
* @since 4.0.0
|
131 |
*/
|
132 |
-
const DISPLAY_LIMIT = '
|
133 |
|
134 |
/**
|
135 |
* @since 4.0.0
|
2 |
|
3 |
namespace ots;
|
4 |
|
5 |
+
const VERSION = '4.0.1';
|
6 |
|
7 |
|
8 |
interface Options {
|
129 |
/**
|
130 |
* @since 4.0.0
|
131 |
*/
|
132 |
+
const DISPLAY_LIMIT = 'all';
|
133 |
|
134 |
/**
|
135 |
* @since 4.0.0
|
includes/TeamMember.php
CHANGED
@@ -29,7 +29,11 @@ class TeamMember {
|
|
29 |
}
|
30 |
|
31 |
public function __isset( $key ) {
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
public function __unset( $key ) {
|
29 |
}
|
30 |
|
31 |
public function __isset( $key ) {
|
32 |
+
|
33 |
+
$meta = get_post_meta( $this->post->ID, $this->prefix( $key ) );
|
34 |
+
|
35 |
+
return !empty( $meta );
|
36 |
+
|
37 |
}
|
38 |
|
39 |
public function __unset( $key ) {
|
includes/functions.php
CHANGED
@@ -13,12 +13,9 @@ namespace ots;
|
|
13 |
function get_members_in_order( $limit = null, $group = false ) {
|
14 |
|
15 |
if ( is_null( $limit ) ) {
|
16 |
-
|
17 |
$limit = get_option( Options::DISPLAY_LIMIT );
|
18 |
-
|
19 |
}
|
20 |
|
21 |
-
|
22 |
$args = array(
|
23 |
'post_type' => 'team_member',
|
24 |
'posts_per_page' => empty( $limit ) || strtolower( $limit == 'all' ) ? -1 : $limit,
|
@@ -29,10 +26,23 @@ function get_members_in_order( $limit = null, $group = false ) {
|
|
29 |
|
30 |
if( !empty( $group ) ) {
|
31 |
|
32 |
-
$args['tax_query']
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
);
|
37 |
|
38 |
}
|
@@ -216,8 +226,12 @@ function get_member_articles( $member = null ) {
|
|
216 |
|
217 |
$article = get_post_meta( $member->ID, "team_member_article$ctr", true );
|
218 |
|
219 |
-
if( !empty( $article )
|
220 |
-
|
|
|
|
|
|
|
|
|
221 |
}
|
222 |
|
223 |
}
|
13 |
function get_members_in_order( $limit = null, $group = false ) {
|
14 |
|
15 |
if ( is_null( $limit ) ) {
|
|
|
16 |
$limit = get_option( Options::DISPLAY_LIMIT );
|
|
|
17 |
}
|
18 |
|
|
|
19 |
$args = array(
|
20 |
'post_type' => 'team_member',
|
21 |
'posts_per_page' => empty( $limit ) || strtolower( $limit == 'all' ) ? -1 : $limit,
|
26 |
|
27 |
if( !empty( $group ) ) {
|
28 |
|
29 |
+
$args['tax_query'] = array(
|
30 |
+
'relation' => 'OR',
|
31 |
+
array(
|
32 |
+
'taxonomy' => 'team_member_position',
|
33 |
+
'field' => 'name',
|
34 |
+
'terms' => $group
|
35 |
+
),
|
36 |
+
array(
|
37 |
+
'taxonomy' => 'team_member_position',
|
38 |
+
'field' => 'slug',
|
39 |
+
'terms' => $group
|
40 |
+
),
|
41 |
+
array(
|
42 |
+
'taxonomy' => 'team_member_position',
|
43 |
+
'field' => 'term_id',
|
44 |
+
'terms' => $group
|
45 |
+
),
|
46 |
);
|
47 |
|
48 |
}
|
226 |
|
227 |
$article = get_post_meta( $member->ID, "team_member_article$ctr", true );
|
228 |
|
229 |
+
if( !empty( $article ) ) {
|
230 |
+
|
231 |
+
if ( !empty( $post = get_post( $article ) ) ) {
|
232 |
+
$articles[] = $post;
|
233 |
+
}
|
234 |
+
|
235 |
}
|
236 |
|
237 |
}
|
includes/team-view.php
CHANGED
@@ -35,7 +35,7 @@ function do_shortcode_output( $attributes = array() ) {
|
|
35 |
'single_template' => get_option( Options::SINGLE_TEMPLATE )
|
36 |
);
|
37 |
|
38 |
-
return do_team_view_output( shortcode_atts( $defaults, $attributes ) );
|
39 |
|
40 |
}
|
41 |
|
@@ -54,8 +54,14 @@ function do_team_view_output( array $args = array() ) {
|
|
54 |
|
55 |
$args = wp_parse_args( $args, $defaults );
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
// Cache the post query
|
58 |
$args['members'] = get_members_in_order( $args['limit'], $args['group'] );
|
|
|
59 |
|
60 |
// See if the template belongs to this plugin
|
61 |
$file = template_path( map_template( $args['template'] ) );
|
@@ -65,7 +71,7 @@ function do_team_view_output( array $args = array() ) {
|
|
65 |
ob_start();
|
66 |
extract( $args );
|
67 |
|
68 |
-
echo '<div class="ots-team-view" id="' . esc_attr( $args['id'] ) . '">';
|
69 |
|
70 |
$template = apply_filters( 'ots_template_include', $file ? $file : $args['template'] );
|
71 |
|
35 |
'single_template' => get_option( Options::SINGLE_TEMPLATE )
|
36 |
);
|
37 |
|
38 |
+
return do_team_view_output( shortcode_atts( $defaults, $attributes, 'our-team' ) );
|
39 |
|
40 |
}
|
41 |
|
54 |
|
55 |
$args = wp_parse_args( $args, $defaults );
|
56 |
|
57 |
+
// Allow for passing multiple groups
|
58 |
+
if ( !empty( $args['group'] ) && !is_array( $args['group'] ) ) {
|
59 |
+
$args['group'] = explode( ',', $args['group'] );
|
60 |
+
}
|
61 |
+
|
62 |
// Cache the post query
|
63 |
$args['members'] = get_members_in_order( $args['limit'], $args['group'] );
|
64 |
+
$args['guid'] = uniqid( 'ots-' );
|
65 |
|
66 |
// See if the template belongs to this plugin
|
67 |
$file = template_path( map_template( $args['template'] ) );
|
71 |
ob_start();
|
72 |
extract( $args );
|
73 |
|
74 |
+
echo '<div class="ots-team-view" id="' . esc_attr( $args['id'] ) . '" data-id="' . esc_attr( $args['guid'] ) . '">';
|
75 |
|
76 |
$template = apply_filters( 'ots_template_include', $file ? $file : $args['template'] );
|
77 |
|
includes/team_member-post-type.php
CHANGED
@@ -309,7 +309,7 @@ function team_member_meta_boxes() {
|
|
309 |
function set_default_post_meta( $post_id, $post, $update ) {
|
310 |
|
311 |
if( !$update ) {
|
312 |
-
update_post_meta( $post_id, 'sc_member_order',
|
313 |
}
|
314 |
|
315 |
}
|
309 |
function set_default_post_meta( $post_id, $post, $update ) {
|
310 |
|
311 |
if( !$update ) {
|
312 |
+
update_post_meta( $post_id, 'sc_member_order', PHP_INT_MAX );
|
313 |
}
|
314 |
|
315 |
}
|
our-team-showcase.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Our Team Showcase
|
4 |
-
* Plugin URI:
|
5 |
-
* Description:
|
6 |
-
* Version: 4.0.
|
7 |
* Author: Smartcat
|
8 |
* Author URI: https://smartcatdesign.net
|
9 |
* License: GPL2
|
1 |
<?php
|
2 |
/*
|
3 |
* Plugin Name: Our Team Showcase
|
4 |
+
* Plugin URI: https://smartcatdesign.net/downloads/our-team-showcase/
|
5 |
+
* Description: Display your team members in a very attractive way as a widget or page with the shortcode [our-team]
|
6 |
+
* Version: 4.0.1
|
7 |
* Author: Smartcat
|
8 |
* Author URI: https://smartcatdesign.net
|
9 |
* License: GPL2
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://smartcatdesign.net/downloads/our-team-showcase/
|
|
4 |
Tags: team, staff, directory, employees, widget, shortcode, members, carousel, honeycomb, stack, grid, custom, template, social, profile, custom post type, portfolio, profile,meet team, skills, cv,v-card, portal
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 4.8.1
|
7 |
-
Stable tag:
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
The best way to display your employees, team members, or any type of list. Multiple appealing templates,SEO friendly, re-order functionality.
|
@@ -88,6 +88,11 @@ Team Member Details & Icons:
|
|
88 |
|
89 |
== Changelog ==
|
90 |
|
|
|
|
|
|
|
|
|
|
|
91 |
= 4.0.0 =
|
92 |
Plugin re-write. Settings and team member data will be maintained
|
93 |
|
4 |
Tags: team, staff, directory, employees, widget, shortcode, members, carousel, honeycomb, stack, grid, custom, template, social, profile, custom post type, portfolio, profile,meet team, skills, cv,v-card, portal
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 4.8.1
|
7 |
+
Stable tag: 4.0.0
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
The best way to display your employees, team members, or any type of list. Multiple appealing templates,SEO friendly, re-order functionality.
|
88 |
|
89 |
== Changelog ==
|
90 |
|
91 |
+
= 4.0.1 =
|
92 |
+
1. Patch plugin code to be backwards compatible with older PHP versions
|
93 |
+
2. Added the ability to display multiple groups in one shortcode
|
94 |
+
3. New members now are added last
|
95 |
+
|
96 |
= 4.0.0 =
|
97 |
Plugin re-write. Settings and team member data will be maintained
|
98 |
|