Skip to content

Commit

Permalink
Make linter happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Sep 12, 2023
1 parent 1738cfc commit 9f9ca19
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/experimental/fonts/font-library/class-wp-font-family.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,9 @@ private function create_font_post() {

/**
* Gets the font faces that are in both the existing and incoming font families.
*
*
* @since 6.4.0
*
*
* @param array $existing The existing font faces.
* @param array $incoming The incoming font faces.
* @return array The font faces that are in both the existing and incoming font families.
Expand Down Expand Up @@ -528,23 +528,23 @@ private function get_intersecting_font_faces( $existing, $incoming ) {
* @return int|WP_Error Post ID if the update was successful, WP_Error otherwise.
*/
private function update_font_post( $post ) {
$post_font_data = json_decode( $post->post_content, true );
$new_data = WP_Font_Family_Utils::merge_fonts_data( $post_font_data, $this->data );
$intersecting = $this->get_intersecting_font_faces( $post_font_data['fontFace'], $new_data['fontFace'] );
$post_font_data = json_decode( $post->post_content, true );
$new_data = WP_Font_Family_Utils::merge_fonts_data( $post_font_data, $this->data );
$intersecting = $this->get_intersecting_font_faces( $post_font_data['fontFace'], $new_data['fontFace'] );

if ( ! empty( $intersecting ) ) {
$serialized_font_faces = array_map( 'serialize', $new_data['fontFace'] );
$serialized_font_faces = array_map( 'serialize', $new_data['fontFace'] );
$serialized_intersecting = array_map( 'serialize', $intersecting );

$diff = array_diff( $serialized_font_faces, $serialized_intersecting );

$new_data['fontFace'] = array_values( array_map( 'unserialize', $diff ) );

foreach ( $intersecting as $intersect ) {
$this->delete_font_face_assets( $intersect );
}
}
$this->data = $new_data;
$this->data = $new_data;

$post = array(
'ID' => $post->ID,
Expand Down

0 comments on commit 9f9ca19

Please sign in to comment.