Auto Paste Attachment Url

Question

i am using on wordpress and wc marketplace, i have a problem. How to auto paste the Featured Video URL label from Featured Video Upload attachment ? i am wanting to add if users upload file on the Local Media url, auto paste the new attachment url to Featured Video Url.

This is my code; add_action( ‘wcmp_after_product_excerpt_metabox_panel’, function( $post_id ){
$woofv_video_embed = maybe_unserialize( get_post_meta( $post_id, ‘_woofv_video_embed’, true ) );
$url = isset( $woofv_video_embed[‘url’] ) ? $woofv_video_embed[‘url’] : ”;
$source = isset( $woofv_video_embed[‘source’] ) ? $woofv_video_embed[‘source’] : ”;
?>

” value=”” class=”form-control”>

>
>

</div>
            <div class="featured-img upload_image">
                <a href="#" class="upload_image_button tips <?php echo $deluxe_img ? 'remove' : ''; ?>" <?php echo current_user_can( 'upload_files' ) ? '' : 'data-nocaps="true" '; ?>data-title="<?php esc_attr_e( 'Featured Video', 'woocommerce' ); ?>" data-button="<?php esc_attr_e( 'Test', 'woocommerce' ); ?>" rel="<?php echo esc_attr( $post->ID ); ?>">
                    <div class="upload-placeholder pos-middle">
                        <i class="wcmp-font ico-image-icon"></i>
                        <p><?php _e( 'Click to upload Featured Video', 'dc-woocommerce-multi-vendor' );?></p>
                    </div>
                    <img src="<?php echo $deluxe_img ? esc_url( wp_get_attachment_image_src( $deluxe_img, 'medium' )[0] ) : esc_url( wc_placeholder_img_src() ); ?>" />

                    <input type="hidden" name="deluxe_img" class="upload_image_id" value="<?php echo esc_attr( $deluxe_img ); ?>" />
                </a>
            </div>

get_id(), ‘_woofv_video_embed’, $woofv_data );

}, 99, 2 );

This is screenshot ; [![enter image description here][1]][1]

[1]: https://i.stack.imgur.com/nGQ4B.png

0
Ridvan Cansiz 1 year 2020-07-26T06:10:26-05:00 0 Answers 55 views 0

Leave an answer

Browse
Browse