How to Send AJAX request from Plugin in WordPress

Plugin is used to add features to the site without modifying the core code.

While building plugin you can also use AJAX to save the form after submit, retrieve data from MySQL database, file upload, etc.

In the plugin, AJAX is implemented as same as implemented on the theme.

In this tutorial, I show how you can create a custom plugin and send an AJAX request in WordPress.

Read more

Call Model method from another Model in CodeIgniter

In CodeIgniter, the Model is used for the Database manipulation – fetch, insert, update, and delete records.

If within the project there are multiple Models are available then it may require to perform the action in a Model which is already created in another Model.

In this case, you can either create a separate function to perform the same action or use the already available method in the Model.

It is possible to reuse the method in the Model from another Model.

Models are loaded in the Model as same as loaded in the Controller using $this->load->model().

In this tutorial, I create 3 Models and call 1st and 2nd Model methods from the 3rd Model.

Call Model method from another Model in CodeIgniter

Read more

How to add Custom Filter in DataTable – AJAX and PHP

DataTables plugin brings enhanced functionality and interactivity to HTML tables, offering features like pagination, sorting, and searching across all columns. By default, DataTables provides a search control that allows users to find values across the entire table and presents a filter list for easy data filtering.

However, the beauty of DataTables lies in its customizability, empowering developers to create tailor-made search filters based on specific record requirements, such as date filtering or single field search.

In this tutorial, we will delve into the process of adding custom filters to DataTables and utilizing AJAX for seamless data retrieval. Let’s get started and elevate the power of DataTables with personalized filtering capabilities.

How to add Custom Filter in DataTable – AJAX and PHP

Read more

DataTables AJAX Pagination with Search and Sort – PHP

DataTables is a powerful jQuery plugin that offers advanced features for tabular data display on a web page. It has pagination, sorting, and filtering features that make managing large amounts of data simple.

It can help you present your data in a way that is both informative and accessible, whether you’re working with simple spreadsheets or complex datasets.

DataTable will automatically adjust data and create pagination with a search and sort feature after you add a data list to the HTML table and initialize it.

There are options available to implement AJAX pagination.

In this tutorial, I show how you can use DataTables with AJAX to implement pagination with search and sort using PHP.

DataTables AJAX Pagination with Search and Sort - PHP

Read more