Skip to content

Instantly share code, notes, and snippets.

View kowsar89's full-sized avatar

Md Kowsar Hossain kowsar89

View GitHub Profile
<?php
/**
* Plugin Name: Disable Textdomain Error
* Description: Prevents triggering errors for the '_load_textdomain_just_in_time' function.
* Author: Kowsar Hossain
* Version: 1.0
*
* Note: This is a Must-Use (MU) plugin. Place this file in the 'wp-content/mu-plugins' directory.
*/
@kowsar89
kowsar89 / form-builder-data-structure.js
Created May 5, 2021 09:11
form-builder-data-structure.js
// meta_key = field_key
// relation_key = key >> original_widget_key
// original_widget_key isn't available for fields which isn't related to form
var submission_form_fields = {
fields: {
title: {
@kowsar89
kowsar89 / autologin.php
Last active January 30, 2021 16:30
Auto login as WordPress Admin
<?php
include('wp-load.php');
$user_id = 1; // Assuming admin user id is 1
wp_set_current_user($user_id);
wp_set_auth_cookie($user_id);
if ( is_user_logged_in() ) {
header('Location: '.admin_url());
<?php
/**
* Plugin Name: MU Var Dump
*
*/
if ( ! defined( 'WPINC' ) ) die;
function k_var_dump($vars){
$file = get_stylesheet_directory().'/testing.html';
$b = '';
@kowsar89
kowsar89 / asset_dynamic_ver.php
Created May 20, 2019 06:21
Apply dynamic version number in all css and js files
<?php
// Apply dynamic version number in all css and js files
add_filter( 'script_loader_src', 'k_script_dynamic_ver_num', 150 );
add_filter( 'style_loader_src', 'k_script_dynamic_ver_num', 150);
function k_script_dynamic_ver_num( $src ){
return add_query_arg( 'ver', time(), $src );
}
{
"sync": false,
"sync_folder": "/media/k/SSD/SublimeSync"
}
@kowsar89
kowsar89 / .htaccess
Created August 10, 2017 06:01
Htaccess for WP site
# Redirect WordPress xmlrpc.php requests
RewriteRule ^xmlrpc\.php$ "http\:\/\/0\.0\.0\.0\/" [R=301,L]
# BEGIN HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>