@@ -314,7 +314,7 @@ public function cloudinary_url( $public_id = null, $args = array(), $size = arra
314314 }
315315
316316 if ( $ attachment_id ) {
317- $ public_id = $ this ->get_public_id ( $ attachment_id , $ public_id , $ args );
317+ $ public_id = $ this ->get_public_id ( $ attachment_id , $ args );
318318 }
319319
320320 $ url_parts [] = $ args ['version ' ];
@@ -796,13 +796,12 @@ public function get_upload_prefix() {
796796 /**
797797 * Get the Cloudinary public_id.
798798 *
799- * @param int $attachment_id The attachment ID.
800- * @param null|string $original_public_id The original public ID.
801- * @param array $args The args.
799+ * @param int $attachment_id The attachment ID.
800+ * @param array $args The args.
802801 *
803802 * @return string
804803 */
805- public function get_public_id ( $ attachment_id , $ original_public_id = null , $ args = array () ) {
804+ public function get_public_id ( $ attachment_id , $ args = array () ) {
806805
807806 $ relationship = Relationship::get_relationship ( $ attachment_id );
808807 $ public_id = null ;
@@ -849,13 +848,15 @@ public function get_public_id( $attachment_id, $original_public_id = null, $args
849848 * @hook cloudinary_seo_public_id
850849 * @since 3.1.5
851850 *
852- * @param $public_id {string} The suffixed public_id.
853- * @param $original_public_id {string } The original public_id .
854- * @param $attachment_id {int} The attachment ID.
851+ * @param $sufix {string} The public_id suffix .
852+ * @param $relationship {Relationship } The relationship .
853+ * @param $attachment_id {int} The attachment ID.
855854 *
856855 * @return {string}
857856 */
858- $ public_id = apply_filters ( 'cloudinary_seo_public_id ' , "{$ public_id }/ {$ filename }. {$ relationship ->format }" , $ original_public_id , $ attachment_id );
857+ $ suffix = apply_filters ( 'cloudinary_seo_public_id ' , "{$ filename }. {$ relationship ->format }" , $ relationship , $ attachment_id );
858+
859+ $ public_id .= "/ {$ suffix }" ;
859860 }
860861
861862 return $ public_id ;
0 commit comments