Category Archives: Web Development

WordPress user creation via custom PHP function

In the code below, we are registering the user via Ajax request and receiving a JSON reply from the script. The code also checks and validates the sent email address against the user information already in the database. You can place the code in your theme’s functions file and send the form via POST to admin-ajax.

Read more

Gravity Forms hook to ban a specific email address

On more than a few projects, I have ended up using Gravity Forms either because it was previously installed or was the need of the hour based on the requirements. Recently, I was asked to ban a certain email address due to frequent spamming by the email address in concern. I am aware of the fact that the spammer can change email address and continue spamming. My task was simple, just ban the email address.

Here is how I chose to complete the task

Read more

Strategy for API using Codeigniter REST!

What was needed?

An existing codeigniter application needed to be fixed, and API endpoints needed to be created for a mobile application.  

How we tackled it?

We implemented REST CodeIgniter API using the RESTful library by CHRIS.  The controllers worked flawlessly out of the box but there was also a requirement for a standalone controller to take care of certain data-exchange, and REST was not an option. A controller was coded to accept the post data, process it and returned the desired result in JSON format. All tests using postman and via jQuery.ajax turned out successful until tests were done from the mobile application itself. Apparently, the mobile application was not sending form-data or x-www-form-urlencoded data. The application was sending JSON data with application/json header which PHP was unable to read using the $_POST or $this->input->post() class of CodeIgniter.

Read more

Wrapped tw-bootstrap

Here is how you can apply bootstrap styles inside any container tag, without affecting tags and elements outside of the container tag.

<div class=”non-bs-parent”><aside></aside> <div class=”bootstrap-inside”>…</div> </div>

Let’s say you want to apply bootstrap only inside the div.bootstrap-inside container. But default bootstrap sylesheet will impact the entire document. Having a wrapped boostrap stylesheet will limit the bootstrap styles inside the container.

Read more

Hide Labels in Gravity Forms for WordPress

This adds a “Hidden” option for hiding labels. Added this to my functions file add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' ); To read more about this, please follow the source link below