Actions and Filters - UCF/UCF-Pegasus-List-Shortcode GitHub Wiki
This plugin includes the following action and filter hooks, which developers can utilize in a theme or other plugin to override specific markup or functionality.
Filters are the primary means of creating and editing layouts in this plugin. For the full list of available layouts included in this plugin, as well as more information about this plugin's layout system, please see our Layout docs.
ucf_pegasus_list_display_{$layoutslug}_before
ucf_pegasus_list_display_{$layoutslug}_content
ucf_pegasus_list_display_{$layoutslug}_after
Returns the opening markup for a Pegasus issue list for the provided $layoutslug
.
For example, to edit the opening markup of the "default" layout, the hook name you'd use would be ucf_pegasus_list_display_default_before
.
-
$markup
stringExisting HTML markup passed along by this filter hook
-
$items
object|arrayOne or more feed items representing Pegasus issues
-
$args
arrayArguments passed in to the
[ucf-pegasus-list]
shortcode
string: Opening HTML markup for the issue list
See instructions on adding or editing existing layouts
Returns the inner markup for a Pegasus issue list for the provided $layoutslug
.
For example, to edit the inner markup of the "default" layout, the hook name you'd use would be ucf_pegasus_list_display_default_content
.
-
$markup
stringExisting HTML markup passed along by this filter hook
-
$items
object|arrayOne or more feed items representing Pegasus issues
-
$args
arrayArguments passed in to the
[ucf-pegasus-list]
shortcode -
$fallback_message
stringA fallback message to display when
$items
is empty
string: Inner HTML markup for the issue list
See instructions on adding or editing existing layouts
Returns the closing markup for a Pegasus issue list for the provided $layoutslug
.
For example, to edit the closing markup of the "default" layout, the hook name would be ucf_pegasus_list_display_default_before
.
-
$markup
stringExisting HTML markup passed along by this filter hook
-
$items
object|arrayOne or more feed items representing Pegasus issues
-
$args
arrayArguments passed in to the
[ucf-pegasus-list]
shortcode
string: Closing HTML markup for the issue list
See instructions on adding or editing existing layouts
Returns all registered layouts for the [ucf-pegasus-list]
shortcode.
If you've defined a custom layout for this shortcode, you should register it with this hook.
-
$layouts
arrayAssociative array of layout slugs (array keys) and their human-friendly names (array values)
array: Modified $layouts
array
function get_pegasus_list_layouts( $layouts ) {
$layouts['mylayout'] = 'My Layout';
return $layouts;
}
add_filter( 'ucf_pegasus_list_get_layouts', 'get_pegasus_list_layouts', 10, 1 );