Created
November 19, 2021 07:31
-
-
Save lgedeon/c83fc6a91f954e9bff7b90f6528b103a to your computer and use it in GitHub Desktop.
Wrapper that ended up being a huge fail.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function add_notice_and_transparency( $widget_area ) { | |
$limit = $this->widget_area_limits()[$widget_area] ?? null; | |
$style = ".ione-module-widget-limit-$limit div:nth-child(n+" . ($limit + 2) . "){opacity:50%}"; | |
if ( $limit ) { | |
printf( | |
'<p class="description">This widget area (sidebar) will only display the first %d widgets.</p><section class="ione-module-widget-limit-%d"><style>%s</style>', | |
absint( $limit ), | |
absint( $limit ), | |
$style | |
); | |
} | |
} | |
public function close_transparency_wrapper( $widget_area ) { | |
$limit = $this->widget_area_limits()[$widget_area] ?? null; | |
if ( $limit ) { | |
echo '</section>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment