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

470
Views
Obtenga la identificación de la publicación actual desde el front-end a través de ajax wordpress
function sendIdToFrontend(){ global $post; $postId = array('post_id' => $post->ID); die(json_encode($postId)); }

Esta es mi función ajax, estoy en una sola página de publicación. Donde tengo un botón que activa esta función. Pero no puedo obtener la identificación de la publicación. ¿Hay algo malo con esta función? Obtengo "nulo" en respuesta.

 jQuery.ajax({ url: ajax_object.ajaxurl, type: 'POST', dataType: 'json', data: {'test': 'test', action: 'checkCorrectAnswersViaAjax'}, success: function(response){ console.log(response); }, error: function(err){ console.log(err); } });
over 4 years ago · Santiago Trujillo
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!