method_get_block_media_query_declarations()

 
 
 
 

method_get_block_media_query_declarations( $block_attributes, $context, $cssprops, $cssSelector, $post_id )

Wraps CSS declarations in a selector block.


Description

Calls method_get_block_css_declarations() and wraps the result in the provided CSS selector. Returns an empty string if no declarations were generated.


Parameters

$block_attributes (array) :
The full block attributes array.

$context (string) :
The breakpoint context.

$cssprops (array) :
Array of property keys.

$cssSelector (string) :
The CSS selector to wrap declarations in (e.g., '#method-abc123').

$post_id (int|false) :
Passed through to method_get_block_css_declarations() for featured-image backgrounds. Default false.


Return

(string) 'selector { declarations }' or empty string.


Source

File: lib/blocks.php


Changelog

VersionDescription
2.0.0-alpha4Introduced (2e1bbd4).
2.0.0-beta6$post_id parameter, passed through to the declarations (09cc16b).
2.0.0-beta15$cssSelector given a default of '', so the optional $post_id no longer follows a required parameter (a67fd5b).