Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
Wordpress WP Media is not working - this.options is undefined

I'm using wp media to upload image using Javascript.

JS Part is here -

handleLogoUpload () {
  var self = this;

  // If the media frame already exists, reopen it.
  if ( this.wpmedia ) {
      this.wpmedia.open();
      return;
  }

  // Create a new media frame
  this.wpmedia = wp.media({
     title: __( 'Select or Upload Media Of Your Chosen Persuasion' ),
     button: {
        text: __( 'Use this media' )
     },
     type : 'image',
     multiple: false
  });

  this.wpmedia.on( 'select', function() {
       // Handle this in my way
  });

  this.wpmedia.open();
},

I've also enqueued the Media library in PHP end.

But when, I just choose an image from Local directory to Upload Getting this error -

Uncaught TypeError: this.options is undefined createAttachmentView http://wpex.test/wp-includes/js/media-views.js?ver=5.9.2:9336

Error Demo in Console

It seems error in media-views.js.

Is there anyone have faced this before.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!