Recent

Styles_Handlerclass

Styles_Handler

Registers and enqueues the Contextual Related Posts front-end styles.

Namespace: WebberZone\Contextual_Related_Posts\Frontend
Since: 3.3.0
Source: includes/frontend/class-styles-handler.php line 22

Methods

__construct()

Constructor class.

Since: 3.3.0
Line: 29

public function __construct(  );

enqueue_all_styles() static

Enqueue every registered style’s CSS, unconditionally.

Since: 4.4.0
Line: 43

static public function enqueue_all_styles(  );

enqueue_style() static

Register and enqueue a single style’s CSS by ID.

Since: 4.4.0
Line: 56

static public function enqueue_style( $style_id );
Type Name Description
string $style_id Style ID (see Settings::get_styles()).

enqueue_style_now() static

Render-time safety net for builders whose widget tree lives outside the queried post — e.g. an Elementor Theme Builder single/archive template, or a header/footer template, where the widget’s own post ID is never the one get_style_ids_to_load() scans. Called directly from the widget’s own render(), where wp_head (and therefore wp_print_styles()) has already fired, so on top of the normal registration this also prints the <link>/inline CSS immediately if it wasn’t already output — wp_print_styles() no-ops on a handle already printed, so this is safe to call unconditionally alongside the wp_enqueue_scripts-time path.

Since: 4.4.0
Line: 89

static public function enqueue_style_now( $style_id );
Type Name Description
string $style_id Style ID (see Settings::get_styles()).

register_styles() static

Enqueue styles.

Line: 108

static public function register_styles(  );

get_style() static

Get the current style for the related posts.

Since: 3.5.0
Line: 313

static public function get_style( $style = ... ): array;
Type Name Description
string $style Style parameter.

Returns: array — Contains two elements: