Skip to content

Commit f174c64

Browse files
author
jomurgel
committed
movies Image component check ater Embed Web Video check
1 parent 11a9d1b commit f174c64

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

includes/apple-exporter/class-component-factory.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public static function initialize(
9393
self::register_component( 'facebook', '\\Apple_Exporter\\Components\\Facebook' );
9494
self::register_component( 'instagram', '\\Apple_Exporter\\Components\\Instagram' );
9595
self::register_component( 'table', '\\Apple_Exporter\\Components\\Table' );
96-
self::register_component( 'img', '\\Apple_Exporter\\Components\\Image' );
9796
self::register_component( 'iframe', '\\Apple_Exporter\\Components\\Embed_Web_Video' );
97+
self::register_component( 'img', '\\Apple_Exporter\\Components\\Image' );
9898
self::register_component( 'video', '\\Apple_Exporter\\Components\\Video' );
9999
self::register_component( 'audio', '\\Apple_Exporter\\Components\\Audio' );
100100
self::register_component( 'heading', '\\Apple_Exporter\\Components\\Heading' );
@@ -145,6 +145,7 @@ private static function register_component( $shortname, $classname ) {
145145
* @return \Apple_Exporter\Components\Component A component class matching the shortname.
146146
*/
147147
public static function get_component( $shortname, $html ) {
148+
148149
$class = self::$components[ $shortname ];
149150

150151
if ( is_null( $class ) || ! class_exists( $class ) ) {
@@ -174,6 +175,7 @@ public static function get_components_from_node( $node ) {
174175
$result = array();
175176

176177
foreach ( self::$components as $shortname => $class ) {
178+
177179
$matched_node = $class::node_matches( $node );
178180

179181
// Nothing matched? Skip to next match.
@@ -190,7 +192,6 @@ public static function get_components_from_node( $node ) {
190192
foreach ( $matched_node as $base_component ) {
191193
$result[] = self::get_component( $base_component['name'], $base_component['value'] );
192194
}
193-
194195
return $result;
195196
}
196197

@@ -199,7 +200,6 @@ public static function get_components_from_node( $node ) {
199200
$result[] = self::get_component( $shortname, $html );
200201
return $result;
201202
}
202-
203203
// Nothing found. Maybe it's a container element?
204204
if ( $node->hasChildNodes() ) {
205205
foreach ( $node->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
@@ -221,5 +221,4 @@ public static function get_components_from_node( $node ) {
221221

222222
return $result;
223223
}
224-
225224
}

0 commit comments

Comments
 (0)