cb-core-components.php
Table of Contents
Functions
- cb_core_set_uri_globals() : mixed
- Sets a global based on the current URI.
- cb_is_current_component() : bool
- Does an entire song and dance to see if this is the component you want.
- cb_is_confetti_bits_component() : bool
- Asks the wizard if we could have some porridge.
- cb_is_user() : mixed
- Checks whether there is a currently logged-in user.
- cb_is_user_confetti_bits() : bool
- Checks to see if we're in the land of wonder.
- cb_core_get_active_components() : array<string|int, mixed>
- Gives us an array of all active components.
Functions
cb_core_set_uri_globals()
Sets a global based on the current URI.
cb_core_set_uri_globals() : mixed
The goal here at one point was to have each component dynamically registered through the URI and accessible via a stacking path, like this:
https://{{domain}}/{{component}}/{{action}}/{{item}}
This is no easy feat. It would also require some significant shenanigans on our end to make that happen. So we've opted to using REST API endpoints, and just checking whether $cb->current_component exists, and is indeed === 'confetti-bits'.
Tags
cb_is_current_component()
Does an entire song and dance to see if this is the component you want.
cb_is_current_component([string $component = '' ]) : bool
- Checks to see if the current component is the same as the supplied component.
- Checks to see if the supplied component has a slug that matches.
- Checks to see if the supplied component is in the array of active components.
- Checks one last time to see if any of the active components has a slug that matches the supplied component.
Parameters
- $component : string = ''
-
The component to check for.
Tags
Return values
bool —True if it's one of ours, false in any other scenario.
cb_is_confetti_bits_component()
Asks the wizard if we could have some porridge.
cb_is_confetti_bits_component() : bool
Tags
Return values
bool —Whether we may have some porridge.
cb_is_user()
Checks whether there is a currently logged-in user.
cb_is_user() : mixed
Tags
cb_is_user_confetti_bits()
Checks to see if we're in the land of wonder.
cb_is_user_confetti_bits() : bool
Tags
Return values
bool —Whether we're in the land of wonder.
cb_core_get_active_components()
Gives us an array of all active components.
cb_core_get_active_components() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Active components.