Skip to content

Commit b3ada65

Browse files
chore: phpcs
1 parent fba8ba5 commit b3ada65

1 file changed

Lines changed: 37 additions & 37 deletions

File tree

inc/compatibilities/jetpack.php

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,42 @@ public function should_load() {
1818
return is_plugin_active( 'jetpack/jetpack.php' );
1919
}
2020

21-
/**
22-
* Register integration details.
23-
*
24-
* @return void
25-
*/
26-
public function register() {
27-
add_filter(
28-
'jetpack_sync_before_send_jetpack_published_post',
29-
function ( $data ) {
30-
Optml_Url_Replacer::instance()->init();
31-
32-
if ( is_array( $data ) ) {
33-
foreach ( $data as $key => &$value ) {
34-
if ( $value instanceof \WP_Post ) {
35-
if ( ! empty( $value->post_content ) ) {
36-
$value->post_content = Optml_Main::instance()->manager->replace_content( $value->post_content );
37-
}
38-
39-
if ( ! empty( $value->post_excerpt ) ) {
40-
$value->post_excerpt = Optml_Main::instance()->manager->replace_content( $value->post_excerpt );
41-
}
42-
43-
if ( isset( $value->featured_image ) && ! empty( $value->featured_image ) ) {
44-
$value->featured_image = apply_filters( 'optml_content_url', $value->featured_image );
45-
}
46-
47-
$data[ $key ] = $value;
48-
}
49-
}
50-
}
51-
52-
return $data;
53-
},
54-
10
55-
);
56-
}
21+
/**
22+
* Register integration details.
23+
*
24+
* @return void
25+
*/
26+
public function register() {
27+
add_filter(
28+
'jetpack_sync_before_send_jetpack_published_post',
29+
function ( $data ) {
30+
Optml_Url_Replacer::instance()->init();
31+
32+
if ( is_array( $data ) ) {
33+
foreach ( $data as $key => &$value ) {
34+
if ( $value instanceof \WP_Post ) {
35+
if ( ! empty( $value->post_content ) ) {
36+
$value->post_content = Optml_Main::instance()->manager->replace_content( $value->post_content );
37+
}
38+
39+
if ( ! empty( $value->post_excerpt ) ) {
40+
$value->post_excerpt = Optml_Main::instance()->manager->replace_content( $value->post_excerpt );
41+
}
42+
43+
if ( isset( $value->featured_image ) && ! empty( $value->featured_image ) ) {
44+
$value->featured_image = apply_filters( 'optml_content_url', $value->featured_image );
45+
}
46+
47+
$data[ $key ] = $value;
48+
}
49+
}
50+
}
51+
52+
return $data;
53+
},
54+
10
55+
);
56+
}
5757

5858
/**
5959
* Should we early load the compatibility?
@@ -63,4 +63,4 @@ function ( $data ) {
6363
public function should_load_early() {
6464
return true;
6565
}
66-
}
66+
}

0 commit comments

Comments
 (0)