Skip to content

Instantly share code, notes, and snippets.

💭
Looking for a new challenge in 2019!

Zakir Sajib zakirsajib

💭
Looking for a new challenge in 2019!
Block or report user

Report or block zakirsajib

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
@zakirsajib
zakirsajib / functions.php
Created Jan 23, 2019
Defer customers to login if they are inactive or cancelled their memberships. But Admin can login.
View functions.php
add_filter( 'authenticate', 'chk_active_user',100,2);
function chk_active_user ($user, $password) {
$user_data = $user->data;
$user_id = $user_data->ID;
if(is_super_admin($user_id)) {
add_filter('authenticate', 'wp_authenticate_username_password', 20);
//add_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 );
//add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );
@zakirsajib
zakirsajib / CSS
Created May 25, 2018
Parallax Background Image in IOS devices
View CSS
.parallax-section {
position: relative;
width: 100%;
height:700px;
}
.parallax-child-section {
clip: rect(0, auto, auto, 0);
position: absolute;
top: 0;
left: 0;
@zakirsajib
zakirsajib / Add New File to WordPress plugin repository via SVN
Last active Jun 22, 2018
WordPress Plugin file add/update/commit via SVN
View Add New File to WordPress plugin repository via SVN
# To add a new screenshot
## First cd to directory and then type
svn add assets/screenshot-5.jpg
# and now commit
svn ci -m "added new screenshot for user profile" assets/screenshot-5.jpg
@zakirsajib
zakirsajib / gist:210f8774ea99eab7e081ba894c344851
Created Mar 1, 2018
Facebook, Instagram and Pinterest hover ACTUAL color
View gist:210f8774ea99eab7e081ba894c344851
a.fb:hover {
color: #3B5998;
}
a.inst:hover {
color: #fb3958;
}
a.pin:hover {
color: #C92228;
}
@zakirsajib
zakirsajib / gist:2b0ce6c85acd0195672f549ce32a8813
Created Mar 1, 2018
Woocommerce product variations custom radio button
View gist:2b0ce6c85acd0195672f549ce32a8813
[type="radio"]:checked,
[type="radio"]:not(:checked) {
position: absolute;
left: -9999px;
}
[type="radio"]:checked + label,
[type="radio"]:not(:checked) + label
{
position: relative;
padding-left: 28px;
@zakirsajib
zakirsajib / functions.php
Created Mar 1, 2018
Change the Login Logo
View functions.php
function my_login_logo() { ?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url('https://xxx.com/wp-content/uploads/2017/11/logo-3.png');
width: auto;
height: 76px;
background-size: contain;
background-position: center center;
}
#login h1 a:focus,
@zakirsajib
zakirsajib / functions.php
Created Mar 1, 2018
Rename Woocommerce message, button
View functions.php
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Billing details' :
$translated_text = __( 'Faktureringsdetaljer', 'woocommerce' );
break;
case 'Your order' :
$translated_text = __( 'Din bestilling', 'woocommerce' );
break;
case 'View cart' :
$translated_text = __( 'Se indkøbsvogn', 'woocommerce' );
@zakirsajib
zakirsajib / functions.php
Created Mar 1, 2018
Rename the "Have a Coupon?" message on the checkout page
View functions.php
function woocommerce_rename_coupon_message_on_checkout() {
return 'Har du en kupon?' . ' <a href="#" class="showcoupon">' . __( 'Klik her for at indtaste din kode', 'woocommerce' ) . '</a>';
}
add_filter( 'woocommerce_checkout_coupon_message', 'woocommerce_rename_coupon_message_on_checkout' );
@zakirsajib
zakirsajib / functions.php
Created Mar 1, 2018
WooCommerce Rename Checkout Fields
View functions.php
add_filter( 'woocommerce_checkout_fields' , 'custom_rename_wc_checkout_fields', 10 );
function custom_rename_wc_checkout_fields( $fields ) {
$fields['billing']['billing_first_name']['placeholder'] = 'Indtast dit fornavn';
$fields['billing']['billing_first_name']['label'] = 'Fornavn';
$fields['billing']['billing_last_name']['placeholder'] = 'Indtast dit efternavn';
$fields['billing']['billing_last_name']['label'] = 'Efternavn';
$fields['billing']['billing_company']['placeholder'] = 'Firmanavn';
$fields['billing']['billing_company']['label'] = 'Firmanavn';
@zakirsajib
zakirsajib / functions.php
Created Mar 1, 2018
Disable WordPress Events and News widget from the dashboard
View functions.php
function wp_remove() {
remove_meta_box( 'dashboard_primary', get_current_screen(), 'side' );
}
add_action( 'wp_network_dashboard_setup', 'wp_remove', 20 );
add_action( 'wp_user_dashboard_setup', 'wp_remove', 20 );
add_action( 'wp_dashboard_setup', 'wp_remove', 20 );
You can’t perform that action at this time.