Skip to content

Commit

Permalink
Update small code issues for clean, performant style
Browse files Browse the repository at this point in the history
  • Loading branch information
bueltge committed Oct 14, 2018
1 parent 2d628ce commit 262ce75
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions multisite-global-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ function mediaSendToEditor(string $html, int $id): string

$search = 'wp-image-'.$id;
$replace = 'wp-image-'.$newId;
$html = str_replace($search, $replace, $html);

return $html;
return str_replace($search, $replace, $html);
}

add_action(
Expand Down Expand Up @@ -273,7 +272,7 @@ function saveThumbnailMeta(int $postId)
$idPrefix = getSideId().'00000';

// phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification
if(!isset($_POST['_thumbnail_id'])) {
if (!isset($_POST['_thumbnail_id'])) {
return;
}

Expand Down Expand Up @@ -412,7 +411,7 @@ function postThumbnailHtml(string $html, int $postId, string $postThumbnailId, $
if (false !== strpos($thumbnailId, $idPrefix)) {
$thumbnailId = str_replace($idPrefix, '', $thumbnailId); // Unique ID, must be a number.

if (intval($siteId) && intval($thumbnailId)) {
if ((int)$siteId && (int)$thumbnailId) {
switch_to_blog($siteId);

$html = wp_get_attachment_image($thumbnailId, $size, false, $attr);
Expand Down

0 comments on commit 262ce75

Please sign in to comment.