Skip to content

Commit 1a7f906

Browse files
authored
Merge pull request #1908 from WordPress/fix/undefined-od-version-constant
Account for `OPTIMIZATION_DETECTIVE_VERSION` not always being defined for Embed Optimizer
2 parents a5c48c4 + 20fea77 commit 1a7f906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/embed-optimizer/hooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function embed_optimizer_update_markup( WP_HTML_Tag_Processor $html_processor, b
190190

191191
// As of 1.0.0-beta3, next_tag() allows $query and is beginning to migrate to skip tag closers by default.
192192
// In versions prior to this, the method always visited closers and passing a $query actually threw an exception.
193-
$tag_query = version_compare( OPTIMIZATION_DETECTIVE_VERSION, '1.0.0-beta3', '>=' )
193+
$tag_query = ! defined( 'OPTIMIZATION_DETECTIVE_VERSION' ) || version_compare( OPTIMIZATION_DETECTIVE_VERSION, '1.0.0-beta3', '>=' )
194194
? array( 'tag_closers' => 'visit' ) : null;
195195
try {
196196
/*

0 commit comments

Comments
 (0)