Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

220
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda