Skip to content

After the 2.4.7 update, the SVG icon shortcode location parameter is always true #116

@techadiacom-sr

Description

@techadiacom-sr

Ocean Extra v2.4.7 introduces $attr['location'] being passed through filter_var() before being handled:

$attr['location']    = filter_var( $attr['location'], FILTER_VALIDATE_BOOLEAN );

filter_var() will convert the string to a boolean, meaning the check for the string in the lines below doesn't work anymore:

if ( isset($attr['location']) && $attr['location'] === "true" ) {
	$location = true;
} else if ( isset($attr['location']) && $attr['location'] === "false" ) {
	$location = false;
}

In order to make it work again, the condition needs to check against the boolean now:

if ( isset($attr['location']) && $attr['location'] === true ) {
	$location = true;
} else if ( isset($attr['location']) && $attr['location'] === false ) {
	$location = false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions