Fix floating target button tag
This commit is contained in:
+10
-12
@@ -163,21 +163,19 @@ final class Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tags = new WP_HTML_Tag_Processor($html);
|
$tags = new WP_HTML_Tag_Processor($html);
|
||||||
while (true) {
|
$tags->next_tag();
|
||||||
|
$tags->set_bookmark('top');
|
||||||
|
foreach ($queries as $query) {
|
||||||
|
$tags->seek('top');
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($queries as $query) {
|
while ($tags->next_tag($query)) {
|
||||||
if ($tags->next_tag($query)) {
|
if (!is_null($args['type_name']) && !empty($args['type_name']) && $tags->get_attribute('type') !== $args['type_name']) continue;
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
foreach ($attributes as $name => $value) {
|
||||||
|
$tags->set_attribute($name, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$found) break;
|
if ($found) break;
|
||||||
|
|
||||||
if (!is_null($args['type_name']) && !empty($args['type_name']) && $tags->get_attribute('type') !== $args['type_name']) continue;
|
|
||||||
|
|
||||||
foreach ($attributes as $name => $value) {
|
|
||||||
$tags->set_attribute($name, $value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $tags->get_updated_html();
|
return $tags->get_updated_html();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user