| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* UsersWP users widget. |
| 8 |
* |
| 9 |
* @since 1.0.22 |
| 10 |
*/ |
| 11 |
class UWP_Users_Item_Widget extends WP_Super_Duper { |
| 12 |
|
| 13 |
/** |
| 14 |
* Register the users widget with WordPress. |
| 15 |
* |
| 16 |
*/ |
| 17 |
public function __construct() { |
| 18 |
|
| 19 |
|
| 20 |
$options = array( |
| 21 |
'textdomain' => 'userswp', |
| 22 |
'block-icon' => 'admin-site', |
| 23 |
'block-category' => 'widgets', |
| 24 |
'block-keywords' => "['userswp','users']", |
| 25 |
'class_name' => __CLASS__, |
| 26 |
'base_id' => 'uwp_users_item', |
| 27 |
'no_wrap' => true, |
| 28 |
'block-wrap' => '', |
| 29 |
'name' => __( 'UWP > Users Item', 'userswp' ), |
| 30 |
'widget_ops' => array( |
| 31 |
'classname' => 'uwp-users-item-class', |
| 32 |
'description' => esc_html__( 'Template for displaying a single user item inside the users loop.', 'userswp' ), |
| 33 |
), |
| 34 |
'arguments' => array() |
| 35 |
|
| 36 |
); |
| 37 |
|
| 38 |
|
| 39 |
parent::__construct( $options ); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* The Super block output function. |
| 44 |
* |
| 45 |
* @param array $args |
| 46 |
* @param array $widget_args |
| 47 |
* @param string $content |
| 48 |
* |
| 49 |
* @return mixed|string|bool |
| 50 |
*/ |
| 51 |
public function output( $args = array(), $widget_args = array(), $content = '' ) { |
| 52 |
|
| 53 |
ob_start(); |
| 54 |
|
| 55 |
$design_style = uwp_get_option( "design_style", 'bootstrap' ); |
| 56 |
|
| 57 |
if ( $design_style == 'bootstrap' ) { |
| 58 |
|
| 59 |
echo do_shortcode( "[uwp_profile_header]" ); |
| 60 |
|
| 61 |
?> |
| 62 |
|
| 63 |
<div class="card-body"> |
| 64 |
<?php echo do_shortcode( "[uwp_output_location location='users']" ); ?> |
| 65 |
</div> |
| 66 |
<div class="card-footer"> |
| 67 |
<?php echo do_shortcode( "[uwp_user_actions]" ); ?> |
| 68 |
</div> |
| 69 |
<?php |
| 70 |
} else { |
| 71 |
echo do_shortcode( "[uwp_profile_header][uwp_user_title tag= 'h4'][uwp_profile_social][uwp_output_location location='users'][uwp_user_actions]" ); |
| 72 |
} |
| 73 |
|
| 74 |
return ob_get_clean(); |
| 75 |
|
| 76 |
} |
| 77 |
|
| 78 |
} |