img_sizes); if($img_sizes==NULL){ $img_sizes=array('thumbnail','medium','large','full'); } foreach($img_sizes as $attachment_size){ $old_img=wp_get_attachment_image_src($attachment_id,$attachment_size); $image_path=explode('/',$old_img[0]); $image_name=end($image_path); $filepath2 = $upload_dir['path'] . DIRECTORY_SEPARATOR . $image_name ; $mime_type = wp_check_filetype($filepath2); $extension = $mime_type['type']; $new_image=$watermark_prefix.$image_name; $filepath = $upload_dir['path'] . DIRECTORY_SEPARATOR.$new_image ; copy($filepath2, $filepath); include ($dir_name . '/controllers/applay_watermark.php'); } include ($dir_name . '/controllers/insert_newpost.php'); } ?>