ID)) return $url; if ( $this->uses_amazon_featured( $post->ID ) === false ) return $url; $url = $this->amazon_featured_get_thumbnail_src( $post->ID ); return $url; } function get_attachment_image_src( $image, $attachment_id, $size, $icon ){ global $post; $id = $post->ID; if( $id == 0 ) return $image; if ( $this->uses_amazon_featured( $id ) === false ) return $image; $image_url = $this->amazon_featured_get_thumbnail_src( $id ); $image = array( $image_url, 0, 0 ); return $image; } function amazon_featured_add_url_metabox() { $excluded_post_types = array('attachment', 'revision', 'nav_menu_item', 'wpcf7_contact_form',); foreach ( get_post_types( '', 'names' ) as $post_type ) { if ( in_array( $post_type, $excluded_post_types ) ) continue; add_meta_box('amazon_featured_url_metabox','Amazon Featured Image',array( $this, 'amazon_featured_url_metabox'),$post_type,'side','default'); } } function amazon_featured_url_metabox( $post ) { $amazon_featured_url = get_post_meta( $post->ID, $this->_amazon_featured_url(), true ); $amazon_featured_alt = get_post_meta( $post->ID, '_amazon_featured_alt', true ); $has_img = strlen( $amazon_featured_url ) > 0; $show_if_img = ''; $hide_if_img = ''; if ( $has_img ) $hide_if_img = 'display:none;'; else $show_if_img = 'display:none;'; ?>