Skip to content

Commit 4010e37

Browse files
author
Marco Pereirinha
committed
Add docblock and fix the default value
1 parent c0db1b9 commit 4010e37

File tree

1 file changed

+13
-1
lines changed
  • cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php

1 file changed

+13
-1
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-media.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,19 @@ public function attachment_url( $url, $attachment_id ) {
633633
if ( false !== $previous_url ) {
634634
return substr( $url, $previous_url );
635635
}
636-
if ( ! doing_action( 'wp_insert_post_data' ) && false === $this->in_downsize && ! apply_filters( 'cloudinary_doing_upload', '__return_false' ) ) {
636+
if (
637+
! doing_action( 'wp_insert_post_data' )
638+
&& false === $this->in_downsize
639+
/**
640+
* Filter doing upload.
641+
* If so, return the default attachment URL.
642+
*
643+
* @param bool Default false.
644+
*
645+
* @return bool
646+
*/
647+
&& ! apply_filters( 'cloudinary_doing_upload', false )
648+
) {
637649
if ( $this->cloudinary_id( $attachment_id ) ) {
638650
$url = $this->cloudinary_url( $attachment_id );
639651
}

0 commit comments

Comments
 (0)