SLP_Power_Pages_UI_Shortcode_slp_pages
extends SLPlus_BaseClass_Object
in package
UI pages stuff on loaded of using pages is enabled.
[slp_pages] is used to create a list of Store Pages that are online.
Table of Contents
Properties
- $categories_selected : array<string|int, string>
- $max_locations : int
- $order : string
- $orderby : string
- $page_retrieval_args : array<string|int, mixed>
- $slplus : SLPlus
- $style : string
- $uses_slplus : bool
- $slplus : mixed
- $uses_slplus : mixed
- $categories_selected : mixed
- $content : mixed
- $max_locations : mixed
- $meta_query : mixed
- $no_map : mixed
- $order : mixed
- $orderby : mixed
- $page_retrieval_args : mixed
- $show_featured : mixed
- $style : mixed
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- get_instance() : SLPlus_BaseClass_Object
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- initalize() : mixed
- Things we do at the start.
- process_shortcode() : string
- Manage the shortcode
- set_properties() : mixed
- Set our properties.
- initialize() : mixed
- Do these things when this object is invoked. Override in your class.
- create_bullet_list() : string
- Style 'bullet' - creates a bullet list of location names.
- create_custom_list() : mixed
- Create a custom list.
- create_full_list() : string
- Style 'full' - creates a full list of location data.
- create_page_list() : string
- Create the list of Store Pages.
- create_string_location_list() : string
- Create the location list string.
- create_summary_list() : string
- Style 'summary' - creates a summary list of location data.
- filter_by_category() : mixed
- Set filters on which pages to return.
- reset() : mixed
- Reset our properties to their initial state.
- set_max_locations() : mixed
- Set the maximum locations to return.
- set_meta_query() : mixed
- Set the meta query.
- set_order() : mixed
- ASC/DESC sort order of the pages.
- set_orderby() : mixed
- Field to sort the pages by.
- set_page_retrieval_args() : mixed
- Set the page retrieval arguments.
Properties
$categories_selected read-only
public
array<string|int, string>
$categories_selected
Array of selected categories.
$max_locations read-only
public
int
$max_locations
Maximum number of locations to return.
$order read-only
public
string
$order
ASC or DESC
$orderby read-only
public
string
$orderby
Field to sort pages list by.
$page_retrieval_args read-only
public
array<string|int, mixed>
$page_retrieval_args
The args used to fetch the page list. property-read boolean $show_featured If not set, show all. If set true = show featured, false = show NOT featured.
$slplus
public
SLPlus
$slplus
$style read-only
public
string
$style
Style of listing
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slplus
protected
mixed
$slplus
$uses_slplus
protected
mixed
$uses_slplus
= \true
$categories_selected
private
mixed
$categories_selected
$content
private
mixed
$content
$max_locations
private
mixed
$max_locations
$meta_query
private
mixed
$meta_query
$no_map
private
mixed
$no_map
$order
private
mixed
$order
$orderby
private
mixed
$orderby
$page_retrieval_args
private
mixed
$page_retrieval_args
$show_featured
private
mixed
$show_featured
$style
private
mixed
$style
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
public
__get(string $property) : SLPlus_BaseClass_Object
Parameters
- $property : string
Return values
SLPlus_BaseClass_Object__isset()
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
boolget_instance()
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
public
static get_instance([bool $no_global = false ][, mixed $params = array() ]) : SLPlus_BaseClass_Object
TODO: PHP7.4 and PHP8.0 the static instance variable returns an object matching $class TODO: PHP8.1 the static instance continually returns the FIRST object (SLP_Admin_Helper) every time -- it is like PHP8.1 static instance is bound to base_class-object versus the calling class object
Parameters
- $no_global : bool = false
-
set to true to skip assigning object to SLP global as a property.
- $params : mixed = array()
-
object init params
Return values
SLPlus_BaseClass_Objectinitalize()
Things we do at the start.
public
initalize() : mixed
process_shortcode()
Manage the shortcode
public
process_shortcode(array<string|int, mixed> $attributes[, string $content = null ]) : string
Parameters
- $attributes : array<string|int, mixed>
-
{ Named array of attributes set in shortcode.
@type string $category Name of category to include. @type string $style Listing style can be 'bullet' or 'summary'. Default 'summary'.
}
- $content : string = null
-
the existing content that we will modify
Tags
Return values
string —the modified HTML content
set_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
initialize()
Do these things when this object is invoked. Override in your class.
protected
initialize() : mixed
create_bullet_list()
Style 'bullet' - creates a bullet list of location names.
private
create_bullet_list() : string
Return values
stringcreate_custom_list()
Create a custom list.
private
create_custom_list() : mixed
create_full_list()
Style 'full' - creates a full list of location data.
private
create_full_list() : string
Return values
stringcreate_page_list()
Create the list of Store Pages.
private
create_page_list() : string
Return values
string —the output
create_string_location_list()
Create the location list string.
private
create_string_location_list(string $output) : string
Parameters
- $output : string
-
The output HTMl with shortcodes.
Return values
stringcreate_summary_list()
Style 'summary' - creates a summary list of location data.
private
create_summary_list() : string
Return values
stringfilter_by_category()
Set filters on which pages to return.
private
filter_by_category(string $category_value) : mixed
Parameters
- $category_value : string
reset()
Reset our properties to their initial state.
private
reset() : mixed
This is needed when we use a singleton method as the memory space is re-used on each shortcode call. We need to make sure that process_shortcode starts with a clean slate on each call.
set_max_locations()
Set the maximum locations to return.
private
set_max_locations(int $max_locations) : mixed
Parameters
- $max_locations : int
set_meta_query()
Set the meta query.
private
set_meta_query(string $value) : mixed
Parameters
- $value : string
set_order()
ASC/DESC sort order of the pages.
private
set_order(string $order) : mixed
Parameters
- $order : string
-
a* = ascending , d* = descending
set_orderby()
Field to sort the pages by.
private
set_orderby(string $orderby) : mixed
Parameters
- $orderby : string
-
a* = ascending , d* = descending
set_page_retrieval_args()
Set the page retrieval arguments.
private
set_page_retrieval_args() : mixed