All Questions
278 questions
0
votes
1
answer
55
views
Simple ajax request with Vanilla JS keeps given 400 Bad Request
I am new to Ajax and hope someone can help me with the following.
I am trying to make simple ajax test in wordpress, but getting al the time a 400 Bad request. I am really wondering why this is not ...
0
votes
0
answers
31
views
How to ajaxify all pages of my Wp Site
I want to ajaxify all my wordpress site pages, how to do that. Is there a plugin for that? Please guide. thank you
0
votes
0
answers
142
views
I am trying to add form using ACF plugin and acf_form() function, but my user fields dont show up properly
I am new at wordpress, so i am very sorry if this is a stupid question, but anyway...
I am trying to create form on frontend to add my custom post types with custom fields which i created using ACF ...
0
votes
0
answers
32
views
Not applying update field (acf) in my plugin
this is my plugin code
<?php
/*
Plugin Name: Unique Auto VIN Fetcher
Description: Fetches vehicle data using VIN from a specified API and fills the data
in custom fields in posts.
Version: 1.0
...
1
vote
1
answer
49
views
Ajax response from Media Selection does not update ALL information more than once
I don't quite know how to explain what is going on, or how to title my post but I'm going to do my best.
I'm making my first plugin for WordPress, which is very simple.
Allow the user to select a ...
0
votes
1
answer
131
views
How to get wp_editor field content when it is inside a Form?
I am working with a plugin where admin needs to send Email to the user. For Email composing I have used wp_editor inside a FORM and the FOMR submission is handling with an AJAX call.
How can I get the ...
0
votes
1
answer
51
views
What is the best way to ignore wordpress administration using add_filter($title) also when Ajax request
Inside a custom plugin to translate Posts contents I use add_filter() and plugins_loaded() hook to replace all $title, $excerpt, $content, $postmeta.
As the documentation says wp Ajax use admin_ajax....
0
votes
1
answer
728
views
How do I call an action hook into wp_ajax hook callback function
I have to trigger an ajax call based on a custom field changes on checkout form which is to add a discount. But if I call the hook to add discount into subtotal of the cart it does not do anything. ...
0
votes
0
answers
69
views
Inline AJAX script passing variables to PHP
I'm creating Referral URL detection plugin. I need that WP plugin enqueue AJAX script inline, which calls/pass variables to PHP script. When I trying to add same code to theme everything works (...
-1
votes
1
answer
21
views
Select posts from list and add them in a new list
There is this fanduel website webpage with functionality to add players from left to selected players list in the right. Also when we click on filtering by position they are filtered without reloading ...
1
vote
1
answer
816
views
wordpress Ajax success doesn't return the value
I have created a plugin where I am recieving the data via rest url and I am getting the correct output when I use var_dump($final_price_return); and no return in success call. PHP code that returns ...
1
vote
0
answers
84
views
Jquery post responses 500 error after some time and lastly an 503 error
I'm currently developing a wordpress plugin that fetches product attributes from 3rd API and creates WooCommerce products using these attrs.
I wrote two different jquery post function nestedly. The ...
0
votes
1
answer
165
views
How to call php file in theme directory from plugin
The goal is to reuse some part of code to login and logout user in ajax with or without reload page .
I can't call the content of php file ajax_user.php inside wordpress template directory from my ...
1
vote
0
answers
71
views
Need help creating asynchronous data scraper in WordPress
I need some help on a data scraping script I've been working on. I want to create a script through which content can be extracted from a page.
I fetched the page via wp_remote_get() and ...
0
votes
0
answers
227
views
admin-ajax.php 500 error when new users try to register
I have WordPress website and I get admin-ajax.php 500 error when new users try to register.
jquery.min.js?ver=3.6.0:2
POST https://example.com/wp-admin/admin-ajax.php 500
send @ jquery.min.js?...
1
vote
1
answer
2k
views
woocommerce search by sku and title ajax
This snippet works only in Title and i need to add also in Metakey SKU.
<?php
// Ajax Search.
function thb_ajax_search() {
check_ajax_referer( 'thb_autocomplete_ajax', 'security' );
$...
0
votes
0
answers
232
views
Ajax call not working in wordpress through a plugin
I have 2 Ajax call the first is working but when it send the data to other the file send_data.php and when I try to run any wordpress function which is add_post_meta it doesn't work!
This's the first ...
0
votes
1
answer
468
views
Send Array from JS to php file then insert it in wp database through a plugin
This's my code it's success but when but I can't the return data from ajax in the same page.
the mechanism is the user click the dropbox button and when he selects it returns dropbox_links and then ...
0
votes
0
answers
55
views
Ajax 400 error when used inside a plugin
I'm really, really stuck.
When I run this code I get a checkbox displayed. When I click the checkbox, the javascript is run. I get "test" in the console, followed by a 400 POST error.
I can ...
0
votes
1
answer
117
views
AJAX call inside plugin class is not getting to it's response function
I've looked at a heap of other people with this same problem but I still can't find a solution. Hopefully someone can see what I've missed because I'm about to pull my hair out.
My ajax call is not ...
0
votes
0
answers
706
views
wc_get_template_part doesnt display the content [duplicate]
hello guys when i try to loop products it's just display the div but not product info
the image of the result
function stsearch_products($data) {
$args = array(
'post_type' => 'product'...
0
votes
0
answers
441
views
Jquery POST Ajax Return null data in wordpress
I really need help on this one. I've been looking at it for hours and been getting nowehere. I am working with ajax in WordPress and this is kind of my first time doing so.
It's always return null ...
0
votes
2
answers
430
views
How do I reinit Wordpress plugins dynamically using jS?
I've implemented a PJAX (push-state AJAX) library on my Wordpress site to handle page transitions, when the page content is updated everything is loading as expected except for Wordpress plugins.
This ...
1
vote
1
answer
591
views
WooCommerce get_price returning wrong price when used via ajax
I'm working on a site that uses the Events Tickets plugin, and I need to get the price of a ticket (Woo product) by ID. I'm using wc_get_product( $ticketID )->get_price(); to to do this.
Adding the ...
0
votes
0
answers
150
views
How can I adjust my function so the page editor still loads in the backend?
I have a live search function which fetches WooCommerce products in realtime.
It works perfectly in the front end, however I notice there is a conflict which blocks my WordPress Editor plugin- Brizy ...
1
vote
0
answers
599
views
Using a custom plugin to capture input data via Ajax and PHP
I'm very new to WordPress, so please excuse my possible lack of understanding. I'm super comfortable with good old vanilla HTML/JS/CSS, and transitioning my hard coded site into WP. My old site had ...
0
votes
1
answer
197
views
Error datatable whit ajax
nice to greet you.
I am trying to integrate datatable js to my plugins but it gives me a 404 error on the end point request
I am following this tutorial.
https://mogul.nz/2020/10/how-to-wordpress-...
0
votes
1
answer
43
views
WordPress Ajax code is not Working
I am developing a WordPress plugin to do shortcode and view PowerBI reports. I have all data in the json file. I have tested the file and the function code. There is no issues with the WordPress codes....
0
votes
0
answers
510
views
Facing Problem with admin-ajax.php URL - Getting 404 with AJAX call
I am trying to get an ajax response on WordPress, currently, it's showing me a 404 error on the staging server but on dev it's working fine.
I know the problem is due to the use of "forward-slash(...
0
votes
1
answer
45
views
Using Wordpress to build membership Page
I wanna built a membership page, which does have the regular stuff for non-members like Landing Page, One-Pager, Contact stuff, imprint etc... and than there should be some sort of registration and if ...
0
votes
1
answer
52
views
Trouble with AJAX using GET
I am creating a event calendar. It works fine on our Intranet fine, but when I copy the plugin to an external site, I keep getting the following:
Sorry, that didn’t work. Please try again or come back ...
0
votes
2
answers
187
views
Render Modula Plugin Shortcode On Ajax Request
I am using Modula Plugin to speedup the galleries creation process. It works wonderfully but I don't understand how to render it correctly on the ajax call. I read through the available posts on ...
0
votes
1
answer
27
views
don't call ajax if not plugin page
I created a plugin that uses ajax the problem is that the plugin requests are loaded on the whole site and not only on the plugin page I need to call the function only on the plugin page
plugin main ...
0
votes
1
answer
61
views
WP Ajax DB issues
I am having a weird issue in regards to getting data from a DB Table via AJAX.
My outcome is to get the employees from the DB and into a dropdown list, but i haven't been able to get it to work.
So ...
0
votes
0
answers
131
views
Calling PHP function with AJAX
I am creating a plugin for wordpress for the backend.
I when the admin press a button a js function is being called. In this js function, I am calling an API, and then I want to call a PHP with the ...
0
votes
1
answer
30
views
Adding LOAD MORE on a page
So I have a blog with different pages and categories and I add each post manually and link it with the URL instead of using post grid. I only want to show 10 posts at a time and add LOAD MORE text ...
0
votes
1
answer
159
views
Response from Php File to Ajax is not getting sent
I am trying to send some response from Php script to Ajax, but it is not getting sent.Below is my code.
For now I am sending dummy data which I will change later..
Php Script..
$response = ['...
1
vote
1
answer
140
views
Ajax contact form widget plugin data not insert in database
I have been working at this for weeks without success. I've figured out problem after problem with the code, but none of the corrections seem to fix my core problem. The form doesn't insert anything ...
1
vote
2
answers
1k
views
$wpdb working with ajax but showing ajax error instead of success
Will someone guide why this code doesn't work. Even the data gets changed.
Here is the ajax I use.
jQuery(document).ready(function($) {
$(".ue_ajax_enabled").on('click', function(event) {...
0
votes
1
answer
970
views
In a plugin, How to update a json file using ajax
Context
Learning plugin creation, i want to save the content of a div each time the user click outside of it.
In a nutshell, the purpose is to create a text backup of a notepad.
I'm working in Local.
...
1
vote
0
answers
611
views
woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
I use woocommerce_package_rates hook on woocommerce so I could change the flat rate on checkout page, but the problem is when someone access the checkout page without js enabled, it will cause the ...
0
votes
0
answers
163
views
Cannot pass value variable to WP AJAX functions
I create plugin to create wizards using jquery steps.
I save all step's values into variable and using ajax to process it, then show using wp ajax function
but only one variable in ajax inserted into ...
0
votes
2
answers
180
views
Ajax Call not Working in Plugin
I've been developing a website using WP and to display some database information in the front-end of the site i've created a plugin. Right now i want to include a filtering function for that same ...
0
votes
1
answer
428
views
jQuery Ajax not loading page with ACF fields
I'm using the following jQuery code to load contents from a template part into another on click.
Without the ACF PHP tags, it works. However, when I add these tags in <?php the_field('field_name'); ...
1
vote
1
answer
253
views
How to save Clicks of a download link button while it doesn't matter if we refresh the page or again login/logout
I am working on a wordpress site and i am little stuck into one situation , what i want is that:_
I have one resume page, which shows resume posts from wp_postmeta table and each post have a downlaod ...
1
vote
1
answer
104
views
Shortcode button dosent work for all posts. Work for first post only
I am creating a custom wordpress theme and i am little stuck in one situation, Actually i added a download link button and add some Java Script on it. The button on all posts showing and downloading ...
0
votes
1
answer
55
views
How to get specific string/value from an array? php [closed]
I am creating a custom wordpress theme and i am little stuck in one situation. I created an array $ark and get some values in it
<?php $ark[] = esc_url( add_query_arg( 'pdff', $post->ID ) ); ...
0
votes
1
answer
936
views
coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
I have a WordPress Frontend Form, that uses AJAX to save data. The form is processed in backend obviously using PHP post, I did a simple solution to inform form submission errors to users if the form ...
0
votes
1
answer
219
views
Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
Help! Cannot figure this out.
I have built a plugin based on this tutorial that gives a user the ability to export a post from a custom post type into a formatted PDF using FPDF.
As it stands, the PDF ...
0
votes
1
answer
158
views
JS working when used normally but not in wordpress
I have a shortcode that prints a simple form, a button is used to submit the form. The problem is that when it's pressed, the form gets submitted normally, ignoring the js function. I can't understand ...