Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion php/class-delivery-feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function enqueue_assets() {
* @return bool
*/
public function is_enabled() {
return 'on' === $this->config[ $this->enable_slug ];
return $this->is_active() && 'on' === $this->config[ $this->enable_slug ];
}

/**
Expand Down
12 changes: 8 additions & 4 deletions php/class-delivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,11 @@ public function convert_tags( $content, $context = 'view' ) {
if ( empty( $relation['public_id'] || $url === $relation['public_id'] ) ) {
continue; // We don't need the public_id relation item.
}
$base = $type . ':' . $url;
$public_id = ! is_admin() ? $relation['public_id'] . '.' . $relation['format'] : null;
$aliases[ $base ] = $this->media->cloudinary_url( $relation['post_id'], array(), $relation['transformations'], $public_id );
$base = $type . ':' . $url;
$public_id = ! is_admin() ? $relation['public_id'] . '.' . $relation['format'] : null;
$cloudinary_url = $this->media->cloudinary_url( $relation['post_id'], array(), $relation['transformations'], $public_id );
$aliases[ $base . '?' ] = $cloudinary_url . '&';
$aliases[ $base ] = $cloudinary_url;
}

// Create the sized found relations second.
Expand All @@ -909,7 +911,9 @@ public function convert_tags( $content, $context = 'view' ) {
$aliases[ $local_url ] = $cached[ $local_url ];
continue;
}
$aliases[ $local_url ] = $this->media->cloudinary_url( $relation['post_id'], explode( 'x', $size ), $relation['transformations'], $public_id );
$cloudinary_url = $this->media->cloudinary_url( $relation['post_id'], explode( 'x', $size ), $relation['transformations'], $public_id );
$aliases[ $local_url . '?' ] = $cloudinary_url . '&';
$aliases[ $local_url ] = $cloudinary_url;
}
}

Expand Down
10 changes: 10 additions & 0 deletions php/class-svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ public function maybe_setup_metadata( $attachment_id, $result ) {
}
}

/**
* Check if component is active.
*
* @return bool
*/
public function is_active() {
// It's always active if on.
return 'on' === $this->config[ $this->enable_slug ];
}

/**
* Setup the component
*/
Expand Down