Skip to content

Commit 3d3c59b

Browse files
committed
- Add [publishpress_authors_list] shortcode to the Free version publishpress#706
1 parent ed2397e commit 3d3c59b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/core/Plugin.php

+16
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public function __construct()
110110

111111
add_shortcode('publishpress_authors_box', [$this, 'shortcodeAuthorsBox']);
112112
add_shortcode('publishpress_authors_data', [$this, 'shortcodeAuthorsData']);
113+
add_shortcode('publishpress_authors_list', [$this, 'shortcodeAuthorsList']);
113114

114115
// Action to display the author box
115116
add_action('pp_multiple_authors_show_author_box', [$this, 'action_echo_author_box'], 10, 5);
@@ -1749,6 +1750,21 @@ public function shortcodeAuthorsBox($attributes)
17491750
return $this->get_author_box_markup('shortcode', $show_title, $layout, $archive, $post_id);
17501751
}
17511752

1753+
public function shortcodeAuthorsList($attributes)
1754+
{
1755+
$widget = new Authors_Widget('authors_list_shortcode', 'authors_list_shortcode');
1756+
1757+
$defaults = [
1758+
'show_title' => true
1759+
];
1760+
1761+
$attributes = wp_parse_args($attributes, $defaults);
1762+
1763+
ob_start();
1764+
$widget->widget([], $attributes);
1765+
return ob_get_clean();
1766+
}
1767+
17521768
/**
17531769
* Shortcode to get the authors data
17541770
*

0 commit comments

Comments
 (0)