Builder_Atts
Renders builder attributes through the Top 10 shortcode with the plugin’s saved settings restored as the fallback for any control the user left blank.
Namespace: WebberZone\Top_Ten\Pro\Builders
Since: 4.5.0
Source: includes/pro/builders/class-builder-atts.php line 24
Methods
render() static
Run builder attributes through the Top 10 shortcode.
Since: 4.5.0
Line: 88
static public function render( array $atts, $content = ... ): string;
| Type | Name | Description |
|---|---|---|
array |
$atts |
Attributes passed by the builder. |
string|null |
$content |
Shortcode content, if any. |
Returns: string — Rendered popular posts.
fill_missing_shortcode_defaults() static
Restore saved settings as defaults and register arbitrary attributes supplied by a builder.
The shortcode’s own defaults are merged after the saved settings. This means values such as
offset can otherwise shadow a builder fallback, while attributes not present in the saved
settings are silently discarded by shortcode_atts().
Since: 4.5.0
Line: 113
static public function fill_missing_shortcode_defaults( $defaults, $atts ): array;
| Type | Name | Description |
|---|---|---|
array |
$defaults |
Shortcode defaults. |
array |
$atts |
Builder attributes. |
Returns: array — Updated shortcode defaults.
strip_empty_atts() static
Drop untouched builder controls so they fall back to saved plugin settings.
Since: 4.5.0
Line: 143
static public function strip_empty_atts( array $atts, array $preserve = ... ): array;
| Type | Name | Description |
|---|---|---|
array |
$atts |
Builder settings. |
string[] |
$preserve |
Keys whose empty value is meaningful. |
Returns: array
merge_other_attributes() static
Parse the free-text other_attributes field into shortcode attributes.
Both the block’s URL-style query string and space-separated shortcode attribute pairs are accepted so builder controls behave consistently with the existing Top 10 block.
Since: 4.5.0
Line: 170
static public function merge_other_attributes( array $atts ): array;
| Type | Name | Description |
|---|---|---|
array |
$atts |
Builder settings. |
Returns: array
resolve_exclude_categories() static
Resolve category slugs into Top 10 term-taxonomy IDs.
Since: 4.5.0
Line: 293
static public function resolve_exclude_categories( array $atts ): array;
| Type | Name | Description |
|---|---|---|
array |
$atts |
Builder settings. |
Returns: array
ensure_style_enqueued() static
Enqueue the style resolved by a builder element at render time.
Since: 4.5.0
Line: 330
static public function ensure_style_enqueued( array $atts, bool $skip_enqueue = ... ): void;
| Type | Name | Description |
|---|---|---|
array |
$atts |
Resolved builder settings. |
bool |
$skip_enqueue |
Skip enqueueing, used by Bricks while rendering its preview buffer. |
Returns: void
get_style_options() static
Get style options for a page-builder control.
Since: 4.5.0
Line: 351
static public function get_style_options( bool $flipped = ... ): array;
| Type | Name | Description |
|---|---|---|
bool |
$flipped |
Whether to return label-to-value options for WPBakery. |
Returns: array — string>