This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use jQuery to replace product thumbnails with full-size images in admin | |
* @author: Faisal Ahammad | |
*/ | |
function replace_admin_thumbnails_with_fullsize_js() { | |
$screen = get_current_screen(); | |
if (!$screen || $screen->base !== 'edit' || $screen->post_type !== 'product') { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_package_rates', 'hide_shipping_when_free_is_available', 100); | |
function hide_shipping_when_free_is_available($rates) { | |
$free = array(); | |
// Find free shipping methods | |
foreach ($rates as $rate_id => $rate) { | |
if ('free_shipping' === $rate->method_id) { | |
$free[$rate_id] = $rate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpb_disable_feed() { | |
wp_die( __('No feed available, please visit our <a href="' . | |
get_bloginfo('url') . '">homepage</a>!') ); | |
} | |
add_action('do_feed', 'wpb_disable_feed', 1); | |
add_action('do_feed_rdf', 'wpb_disable_feed', 1); | |
add_action('do_feed_rss', 'wpb_disable_feed', 1); | |
add_action('do_feed_rss2', 'wpb_disable_feed', 1); | |
add_action('do_feed_atom', 'wpb_disable_feed', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable Admin Notices WordPress | |
* Description: Completely removes all admin notices from the WordPress dashboard, | |
* including core WordPress notices and those added by plugins and themes. | |
* @author Faisal Ahammad <[email protected]> | |
*/ | |
// Exit if accessed directly | |
if (!defined('ABSPATH')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ninja Forms - Disable Past Dates and Sundays in Advanced Datepicker | |
* @author Faisal Ahammad | |
*/ | |
jQuery(document).ready(function ($) { | |
function initCustomDatePicker() { | |
var customDatePicker = Marionette.Object.extend({ | |
initialize: function () { | |
this.listenTo(Backbone.Radio.channel("flatpickr"), "init", this.modifyDatepicker); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove thousand separator from WordPress pagination | |
* @author Faisal Ahammad | |
*/ | |
/** | |
* @param $output | |
* @return mixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce Merge Email and Phone on Checkout | |
* @author Faisal Ahammad | |
*/ | |
add_filter( 'woocommerce_checkout_fields', 'customize_checkout_fields_checkout' ); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Woocommerce Add Phone Number To Login Account | |
* @author Faisal Ahammad | |
*/ | |
// Enable login with phone number or email | |
add_filter( 'authenticate', 'login_with_phone_or_email', 20, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Woocommerce Add Phone Number Field To Registration Form | |
* @author Faisal Ahammad | |
*/ | |
add_action( 'woocommerce_register_form', 'add_phone_field_to_registration' ); | |
function add_phone_field_to_registration() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ninja Forms - Compare Two Field Email Address and Display Error | |
* @author Faisal Ahammad | |
*/ | |
/** | |
* Form ID: replace the #nf-form-1-cont form ID with your desire form ID | |
* Email 1 class: add student_email or different class to the field "Email field setting → Display → Element" | |
* Email 2 class: add agent_email or different class to the field "Email field setting → Display → Element" | |
* Warning Message class: add warning_message or different class to the "HTML field setting → Display → Container" |
NewerOlder