Category Coding

Products related to Coding

Bulk Task Editor for User Roles

Efficiently Adjusting User Roles After WordPress Multisite Import

Managing a large WordPress Multisite installation can be challenging, especially when you need to make bulk changes to user roles across thousands of blogs. This post explores how to automate the process of changing user roles using the Bulk Task Editor (BTE) for WordPress. Let's focus on a real-life use case where you need to edit the role of tens of thousands of users from subscribers to administrators for their respective blogs after a mass .
Canned Spam

Stopping WordPress trackback spam without plugin

What is the most effective method for combating the trackback spam that inundates comment sections? Altering the global Trackbacks configuration through the Dashboard -> Settings -> Discussion will exclusively modify the default behavior. If you presently have posts or pages with trackbacks enabled, adjusting the default setting won't affect the individual post-level settings. To address this issue use the following filter to programmatically disapprove any trackback or pingback: add_filter('pre_comment_approved',function($approved,$comment){ if( in_array($comment['comment_type'],array( 'trackback', 'pingback', ))){  .
Translate a text with Amazon Translate using AWS SDK for PHP

Translate a text with Amazon Translate using AWS SDK for PHP

In a previous tutorial named "Integrating an AWS Service into a WP Plugin Boilerplate" we learned to use the free version of WP Package Editor (WP2E) to integrate the AWS Translate Service into a WordPress Plugin Boilerplate. In this tutorial, we have prepared the necessary setup and installed the boilerplate project and AWS SDK dependency in order to integrate Amazon Translate into a WordPress environment. Create an IAM Policy To translate a string using the AWS Translate service, you will need to .

Integrating an AWS Service into a WP Plugin Boilerplate

In this tutorial we are going to learn how to use the free version of WP Package Editor (WP2E) to integrate the AWS Translate Service into a WordPress Plugin Boilerplate. About WP Package Editor (WP2E) The core functionality of WP Package Editor (WP2E) is to create and manage installation packages to quickly deliver and maintain a set of interdependent WordPress scripts such as themes and plugins from a single dashboard. The platform provides 3 types of resource: WP Package Installers - Installer .
How to redirect WooCommerce "add to cart" button to the checkout page without plugin?

How to redirect WooCommerce “add to cart” button to the checkout page without plugin?

These are the simple settings in WooCommerce to skip the cart page after Adding a product to the basket: 1 - From admin dashboard go to WooCommerce > Settings > Products > General >next to "Add to cart behavior" make sure the option "Redirect to the cart page after successful addition" is checked. 2 - Moving to WooCommerce > Settings > Advanced > remove the checkout page ID from the checkout field and add the checkout .

10+ Solutions for Responsive Data Tables

Having trouble fitting your tables into a responsive site? They look great on a desktop layout, but look miserable on mobile. The Basics First remove any fixed widths from your markup. Before: <table width="540"> <tr> <td width="300"> Header 1 < /td> <td width="60"> Header 2 < /td> <td> Header 3 < /td> <td> Header 4 < /td> < /tr> < /table> After: <table> <tr>  .

PHP Format Numbers to Nearest Thousands

Here comes a PHP function to format numbers to nearest thousands such as Kilos, Millions, Billions, and Trillions with comma. Function function thousandsCurrencyFormat($num) { if( $num > 1000 ) { $x = round($num); $x_number_format = number_format($x); $x_array = explode(',', $x_number_format); $x_parts = array('k', 'm', 'b', .
How to Combine Javascript Files In WordPress without Plugin?

How to Combine Javascript Files In WordPress without Plugin?

To combine the javascript files in WordPress with php and without Plugin, first, we must know all of the javascript files along with its handle name loaded on the web page without seeing the web source as we did in the manual way. Knowing all of the javascript files loaded in a web page We can find all of information about the javascript files loaded in a WordPress page in the WP_Scripts object. This object is stored .
Twitter Data

Scraping Tweets Directly from Twitter without authentication

In fairly recent news, Twitter has started indexing it’s entire history of Tweets going all the way back to 2006. However, even with this news (at time of writing), their search API is still restricted to the past seven days of Tweets. While I doubt this will be the case permanently, as a useful exercise this post presents how we can search for Tweets from Twitter without necessarily using their API. Besides the indexing, there is also the .