Skip to content

Commit

Permalink
fix (php): addressed remaining stripos function warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bfintal committed Jan 27, 2023
1 parent abb7bd5 commit cd8b072
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/deprecated/v2/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,9 @@ function stackable_add_required_block_styles_v2() {
if ( ! function_exists( 'load_frontend_scripts_conditionally_v2') ) {

function load_frontend_scripts_conditionally_v2( $block_content, $block ) {
$block_name = isset( $block['blockName'] ) ? $block['blockName'] : '';
if (
stripos( $block['blockName'], 'ugb/' ) === 0 ||
stripos( $block_name, 'ugb/' ) === 0 ||
stripos( $block_content, '<!-- wp:ugb/' ) !== false
) {
stackable_block_enqueue_frontend_assets_v2();
Expand Down Expand Up @@ -363,8 +364,9 @@ function register_frontend_blog_posts_block_compatibility_v2() {
* @return string The block content
*/
function stackable_frontend_v2_try_migration( $block_content, $block ) {
$block_name = isset( $block['blockName'] ) ? $block['blockName'] : '';
if (
stripos( $block['blockName'], 'ugb/' ) === 0 ||
stripos( $block_name, 'ugb/' ) === 0 ||
stripos( $block_content, '<!-- wp:ugb/' ) !== false
) {
stackable_frontend_v2_try_migration_detected();
Expand Down
3 changes: 2 additions & 1 deletion src/dynamic-breakpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ public function enqueue_adjusted_responsive_css() {
* @return void
*/
public function adjust_block_styles( $block_content, $block ) {
$block_name = isset( $block['blockName'] ) ? $block['blockName'] : '';
if (
stripos( $block['blockName'], 'stackable/' ) === 0 ||
stripos( $block_name, 'stackable/' ) === 0 ||
stripos( $block_content, '<!-- wp:stackable/' ) !== false
) {
$block_content = apply_filters( 'stackable_frontend_css', $block_content );
Expand Down

0 comments on commit cd8b072

Please sign in to comment.