Skip to content

Commit

Permalink
Fix: issue with woocommerce product gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxiang committed Nov 27, 2018
1 parent a3f98fd commit b87a133
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions external-media-without-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ function init_emwi() {
add_action( 'wp_ajax_add_external_media_without_import', 'emwi\wp_ajax_add_external_media_without_import' );
add_action( 'admin_post_add_external_media_without_import', 'emwi\admin_post_add_external_media_without_import' );

add_filter( 'get_attached_file', function( $file, $attachment_id ) {
if ( empty( $file ) ) {
// TODO: query guid of post with $attachment_id.
}
return $file;
}, 10, 2 );

function add_submenu() {
add_submenu_page(
'upload.php',
Expand Down

0 comments on commit b87a133

Please sign in to comment.