Skip to content

Commit

Permalink
Manifest error #4
Browse files Browse the repository at this point in the history
  • Loading branch information
iworks committed Nov 17, 2023
1 parent 596dec5 commit 6b4ddc6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions includes/iworks/pwa/class-iworks-pwa-manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,19 @@ private function print_manifest_json() {
}
array_unshift( $data['icons'], $one );
}
$data['shortcuts'] = $this->get_shortcuts();
$data['id'] = $this->get_configuration_app_id();
/**
* Check shortcuts and use it obnly when not empty.
*
* @since 1.5.7
*/
$shortcuts = $this->get_shortcuts();
if ( ! empty( $shortcuts ) && is_array( $shortcuts ) ) {
$data['shortcuts'] = $shortcuts;
}
/**
* app id
*/
$data['id'] = $this->get_configuration_app_id();
header( 'Content-Type: application/json' );
echo json_encode( $data );
exit;
Expand Down

0 comments on commit 6b4ddc6

Please sign in to comment.