@@ -29,42 +29,42 @@ class Admin_Banner {
2929 *
3030 * @var array<string, mixed>
3131 */
32- private array $ config = array ();
32+ public array $ config = array ();
3333
3434 /**
3535 * Derived class names keyed by component.
3636 *
3737 * @var array<string, array<int, string>>
3838 */
39- private array $ class_names = array ();
39+ public array $ class_names = array ();
4040
4141 /**
4242 * Localized strings.
4343 *
4444 * @var array<string, string>
4545 */
46- private array $ strings = array ();
46+ public array $ strings = array ();
4747
4848 /**
4949 * Style configuration.
5050 *
5151 * @var array<string, mixed>
5252 */
53- private array $ style = array ();
53+ public array $ style = array ();
5454
5555 /**
5656 * Base class prefix shared by all banners.
5757 *
5858 * @var string
5959 */
60- private string $ base_prefix = 'wz-admin-banner ' ;
60+ public string $ base_prefix = 'wz-admin-banner ' ;
6161
6262 /**
6363 * Unique class prefix derived from the provided prefix.
6464 *
6565 * @var string
6666 */
67- private string $ unique_prefix = 'admin-banner ' ;
67+ public string $ unique_prefix = 'admin-banner ' ;
6868
6969 /**
7070 * Constructor.
@@ -108,7 +108,7 @@ public function __construct( array $config ) {
108108 /**
109109 * Register hooks.
110110 */
111- private function hooks (): void {
111+ public function hooks (): void {
112112 Hook_Registry::add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'maybe_enqueue_styles ' ) );
113113 Hook_Registry::add_action ( 'in_admin_header ' , array ( $ this , 'render ' ) );
114114 }
@@ -197,7 +197,7 @@ public function render(): void {
197197 /**
198198 * Enqueue the banner stylesheet.
199199 */
200- private function enqueue_style (): void {
200+ public function enqueue_style (): void {
201201 wp_register_style (
202202 $ this ->style ['handle ' ],
203203 $ this ->style ['url ' ],
@@ -213,7 +213,7 @@ private function enqueue_style(): void {
213213 * @param \WP_Screen $screen Current admin screen.
214214 * @param string $page_slug Current request page slug.
215215 */
216- private function should_render_on_screen ( \WP_Screen $ screen , string $ page_slug ): bool {
216+ public function should_render_on_screen ( \WP_Screen $ screen , string $ page_slug ): bool {
217217 $ screen_base = (string ) $ screen ->base ;
218218 if ( '' !== $ screen_base && in_array ( $ screen_base , (array ) $ this ->config ['exclude_screen_bases ' ], true ) ) {
219219 return false ;
@@ -237,7 +237,7 @@ private function should_render_on_screen( \WP_Screen $screen, string $page_slug
237237 * @param \WP_Screen $screen Current admin screen.
238238 * @param string $page_slug Current request page slug.
239239 */
240- private function resolve_current_section ( \WP_Screen $ screen , string $ page_slug ): string {
240+ public function resolve_current_section ( \WP_Screen $ screen , string $ page_slug ): string {
241241 $ screen_id = (string ) $ screen ->id ;
242242
243243 foreach ( $ this ->config ['sections ' ] as $ section_key => $ section ) {
@@ -260,7 +260,7 @@ private function resolve_current_section( \WP_Screen $screen, string $page_slug
260260 *
261261 * @param array $strings Raw strings array.
262262 */
263- private function prepare_strings ( array $ strings ): array {
263+ public function prepare_strings ( array $ strings ): array {
264264 $ defaults = array (
265265 'region_label ' => '' ,
266266 'nav_label ' => '' ,
@@ -277,7 +277,7 @@ private function prepare_strings( array $strings ): array {
277277 *
278278 * @param string $prefix Base prefix.
279279 */
280- private function resolve_wrapper_prefix ( string $ prefix ): string {
280+ public function resolve_wrapper_prefix ( string $ prefix ): string {
281281 $ prefix = sanitize_key ( $ prefix );
282282
283283 if ( '' === $ prefix ) {
@@ -292,7 +292,7 @@ private function resolve_wrapper_prefix( string $prefix ): string {
292292 *
293293 * @param array $style Style configuration.
294294 */
295- private function prepare_style_config ( array $ style ): array {
295+ public function prepare_style_config ( array $ style ): array {
296296 $ defaults = array (
297297 'handle ' => $ this ->sanitize_handle ( "{$ this ->unique_prefix }-styles " ),
298298 'deps ' => array (),
@@ -319,7 +319,7 @@ private function prepare_style_config( array $style ): array {
319319 *
320320 * @return array
321321 */
322- private function sanitize_sections ( array $ sections ): array {
322+ public function sanitize_sections ( array $ sections ): array {
323323 $ sanitized = array ();
324324
325325 foreach ( $ sections as $ key => $ section ) {
@@ -348,7 +348,7 @@ private function sanitize_sections( array $sections ): array {
348348 *
349349 * @return array<string, array<int, string>>
350350 */
351- private function derive_class_names (): array {
351+ public function derive_class_names (): array {
352352 $ build = function ( string $ suffix = '' ): array {
353353 $ classes = array ( $ this ->base_prefix . $ suffix );
354354
@@ -381,7 +381,7 @@ private function derive_class_names(): array {
381381 *
382382 * @return array
383383 */
384- private function collect_targets_from_sections ( string $ target_key ): array {
384+ public function collect_targets_from_sections ( string $ target_key ): array {
385385 $ values = array ();
386386
387387 foreach ( $ this ->config ['sections ' ] as $ section ) {
@@ -401,7 +401,7 @@ private function collect_targets_from_sections( string $target_key ): array {
401401 *
402402 * @param array $section Section configuration.
403403 */
404- private function get_section_link_classes ( array $ section ): array {
404+ public function get_section_link_classes ( array $ section ): array {
405405 $ classes = $ this ->class_names ['link ' ] ?? array ();
406406 $ type = isset ( $ section ['type ' ] ) ? sanitize_key ( $ section ['type ' ] ) : 'secondary ' ;
407407 $ type = '' !== $ type ? $ type : 'secondary ' ;
@@ -422,7 +422,7 @@ private function get_section_link_classes( array $section ): array {
422422 * @param array $classes Class list.
423423 * @return string Class attribute string.
424424 */
425- private function implode_classes ( array $ classes ): string {
425+ public function implode_classes ( array $ classes ): string {
426426 return implode ( ' ' , array_unique ( array_filter ( $ classes ) ) );
427427 }
428428
@@ -432,7 +432,7 @@ private function implode_classes( array $classes ): string {
432432 * @param string $key Classes array key.
433433 * @return string Class attribute string.
434434 */
435- private function class_attr ( string $ key ): string {
435+ public function class_attr ( string $ key ): string {
436436 return $ this ->implode_classes ( $ this ->class_names [ $ key ] ?? array () );
437437 }
438438
@@ -441,14 +441,14 @@ private function class_attr( string $key ): string {
441441 *
442442 * @param string $handle Raw handle.
443443 */
444- private function sanitize_handle ( string $ handle ): string {
444+ public function sanitize_handle ( string $ handle ): string {
445445 return sanitize_title_with_dashes ( $ handle );
446446 }
447447
448448 /**
449449 * Get the current page slug from the request.
450450 */
451- private function get_request_page_slug (): string {
451+ public function get_request_page_slug (): string {
452452 $ page_param_raw = filter_input ( INPUT_GET , 'page ' , FILTER_UNSAFE_RAW );
453453
454454 if ( is_string ( $ page_param_raw ) && '' !== $ page_param_raw ) {
0 commit comments