File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -115,10 +115,15 @@ public function is_synced( $post_id ) {
115115 *
116116 * @param int $post_id The post id to generate a signature for.
117117 *
118- * @return string
118+ * @return string|bool
119119 */
120120 public function generate_signature ( $ post_id ) {
121- $ upload = $ this ->managers ['push ' ]->prepare_upload ( $ post_id );
121+ $ upload = $ this ->managers ['push ' ]->prepare_upload ( $ post_id );
122+ // Check if has an error (ususally due to file quotas).
123+ if ( is_wp_error ( $ upload ) ) {
124+ $ this ->plugin ->components ['media ' ]->get_post_meta ( $ post_id , self ::META_KEYS ['sync_error ' ], $ upload ->get_error_message () );
125+ return false ;
126+ }
122127 $ credentials = $ this ->plugin ->components ['connect ' ]->get_credentials ();
123128 $ upload ['cloud_name ' ] = $ credentials ['cloud_name ' ];
124129 $ return = array_map (
You can’t perform that action at this time.
0 commit comments