| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* UsersWP user's loop actions widget. |
| 8 |
* |
| 9 |
* @since 1.1.2 |
| 10 |
*/ |
| 11 |
class UWP_Users_Loop_Actions extends WP_Super_Duper { |
| 12 |
|
| 13 |
/** |
| 14 |
* Register the user's loop actions 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','user']", |
| 25 |
'class_name' => __CLASS__, |
| 26 |
'base_id' => 'uwp_users_loop_actions', |
| 27 |
'name' => __('UWP > User Loop Action','userswp'), |
| 28 |
'widget_ops' => array( |
| 29 |
'classname' => 'uwp-user-loop-action bsui', |
| 30 |
'description' => esc_html__('Displays user loop actions.','userswp'), |
| 31 |
), |
| 32 |
|
| 33 |
); |
| 34 |
|
| 35 |
|
| 36 |
parent::__construct( $options ); |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* The Super block output function. |
| 41 |
* |
| 42 |
* @param array $args |
| 43 |
* @param array $widget_args |
| 44 |
* @param string $content |
| 45 |
* |
| 46 |
* @return mixed|string|bool |
| 47 |
*/ |
| 48 |
public function output( $args = array(), $widget_args = array(), $content = '' ) { |
| 49 |
|
| 50 |
ob_start(); |
| 51 |
|
| 52 |
$design_style = !empty($args['design_style']) ? esc_attr($args['design_style']) : uwp_get_option("design_style",'bootstrap'); |
| 53 |
$template = $design_style ? $design_style."/users-actions.php" : "users-actions.php"; |
| 54 |
|
| 55 |
uwp_get_template($template, $args); |
| 56 |
|
| 57 |
return ob_get_clean(); |
| 58 |
|
| 59 |
} |
| 60 |
|
| 61 |
} |