Use include (yourclass.php) only if the file yourclass.php is on the same folder. Otherwise you will need to put the full path to your file or use a variable for the plugin path:
public $plugin_path;
$this->plugin_path = plugin_dir_path( dirname( dirname( FILE ) ) );
and include the file using plugin_path.
Related Posts:
- username_exists() function can’t be access without logging in
- WordPress AJAX Pagination with query_posts
- How build a custom login/register form with error handling?
- Do I require the use of nonce?
- Where to include php files in wordpress and how to refer to them later [closed]
- Admin Media grid view images won’t load
- Passing JSON data from WP Query into AJAX causing NULL errors
- Security – Ajax and Nonce use [closed]
- Validate a users email address when using gmail to register
- Use ajax to update_post_meta
- Problem with WordPress Ajax form
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- How to set a custom path, for ajax image upload folder in admin?
- admin-ajax.php responding with 0
- Can I use HTTP POSTs? Is there a better alternative?
- How to make custom total price reactive in navigation
- How to prevent those PHP variables from being cached on WordPress?
- Use ajax from function.php
- get post based on category chosen in drop down – The ajax method
- get current custom post ID by WP_Query method
- Create onClick Event to Re-load a Widget
- Creating a Multi-Level Associative Object Using AJAX
- How to store data from multiple forms using ajax and php
- Ajax loaded form replaces form action with Ajax url
- prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site
- Gutenberg block – Save PHP function’s output as HTML?
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- Ajax date_query not working past the first iteration
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- Posting and image insertion problems after EasyApache4 and PHP 7 upgrade
- How to add a do_action on refreshing of WP customizer?
- [jQuery]Adding shortcode
- Display parent and child taxonomies in separate drop down select fields
- WordPress admin-ajax.php 400 bad request
- Ajax contact form return 0
- AJAX – Returning Two JSON Objects with One PHP Function
- unable to use ‘new WP_Query’ in AJAX call
- admin-ajax Firing Error 400 When Logged In
- is_user_logged_in() not working in AJAX validation call
- Add Ajax Hooks and Call from Custom Template PHP
- WordPress Ajax Always returning 0
- Problem with AJAX in wordpress plugin
- How to keep track of when a vote is cast?
- set post limit at load more ajax wordpress
- Woocommerce with Lazy Load php and ajax
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Can I make get_users() query global?
- Compare $_POST returned values with term array
- How to use AJAX to call php page with parameter
- My jQuery Ajax form submit is still refreshing page?
- javascript variable to wordpress php variable
- Output votes to div dynamically in wordpress
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Incrementing PHP variable onclick to display posts by month
- How to use AJAX in WordPress in MYSQL query?
- Processing ajax call to php to insert into mysql database
- calling admin-ajax.php from admin-ajax.php
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- WordPress Custom Add To Cart Button with AJAX
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Display WordPress search results based on the selected Sub-Category
- Using some Loop or repeatable fucntion in AJAX and PHP to reduce repeatability
- jquery & ajax getting data from php in wordpress . admin-ajax.php returns 400
- Settings API form – submit with AJAX
- How do I call a value from the datase using ajax
- Post form – AJAX won’t upload featured image – Plugin development
- Load more posts using AJAX based on posts inside WP_Query
- PHP calling AJAX function that relies on passed PHP function values not working
- Where to add my PHP codes for AJAX Jquery to work?
- Adding ELSE argument to AJAX Live Search for “No results found”
- How can i find wrong word in search box and replace with correct word
- How to use wp_ajax_set_post_thumbnail?
- register_block_type is not working properly
- Submit remote form to wordpress REST API and save data to custom post type
- WooCommerce REST API AJAX Auth – 401 response
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- AJAX numerical pagination problem in TwentyFifteen-child theme
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Top Authors list by highest post views with Ajax pagination
- Offset with ajax load more posts duplicates
- Custom theme admin-ajax.php 400 (Bad Request)
- number of posts with “Load More”
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- wordpress more than one ajax request at the same time issue
- Include search tags and users in my search results system
- Ajax not updating to database
- Ajax Load more CPT via shortcode
- Apply filters when loading post via ajax
- MySQL query in WordPress with AJAX
- Result from wp_send_json adds line feed
- Is custom behaviour possible when asynchronously uploading?
- Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
- Data inserted in database, but ajax calls error function
- Load Meta box value into div AJAX [duplicate]
- Detecting IP Address of someone using ‘copy’ function [closed]
- How to display inputted data in Ajax without button or click event
- AJAX returning blank result
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- How can I display a Divi content inside a modal based on an AJAX request
- Session seems to break