Skip to content

Instantly share code, notes, and snippets.

View tareq1988's full-sized avatar
🎯
Focusing

Tareq Hasan tareq1988

🎯
Focusing
View GitHub Profile
@tareq1988
tareq1988 / wpuf-woo-price.php
Created January 6, 2016 12:59
WooCommerce price adjustment for WPUF
<?php
/**
* WooCommerce price adjustment for WPUF
*
* @param int $post_id
*
* @return void
*/
function wpufe_update_post_price( $post_id ) {
// ==UserScript==
// @name FB Ban/Unban Like a Boss
// @namespace fb-banlikeaboss-dsd
// @include https://www.facebook.com/*
// @version 2.1
// @grant none
// @require http://cdn.craig.is/js/mousetrap/mousetrap.min.js
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// ==/UserScript==
//Avoid conflicts
@tareq1988
tareq1988 / search-in-meta.php
Last active August 29, 2015 14:19
Search both in wp_usermeta table and wp_users table
<?php
/**
* Search both in wp_usermeta table and wp_users table
*
* By Default WordPress search usermeta and postmeta by using `AND`
* in SQL queries. This filter replaces the `AND` with `OR`. This facilitate
* to search both in user table columns OR user meta columns
*
* @author Tareq Hasan
@tareq1988
tareq1988 / bn-to-en.php
Created January 30, 2015 12:16
Bangla to Phonetic English Conversion
<?php
/**
* Tokenize Unicode strings
*
* @param string $str
* @link http://php.net/str_split
*
* @return array
*/
function str_split_unicode($str) {
@tareq1988
tareq1988 / hook-taxonomy.php
Last active January 7, 2017 00:06
WPUF Action Hook Taxonomy
<?php
/**
* Register a custom taxonomy
*
* @return void
*/
function prefix_register_genere_taxonomy() {
register_taxonomy( 'genere', 'post', array(
'label' => __( 'Genre' ),
@tareq1988
tareq1988 / bootstrap-walker.php
Created September 25, 2014 13:21
Clickable Bootstrap Dropdown
<?php
/**
* Class Name: wp_bootstrap_navwalker
* GitHub URI: https://github.com/twittem/wp-bootstrap-navwalker
* Description: A custom WordPress nav walker class to implement the Bootstrap 3 navigation style in a custom theme using the WordPress built in menu manager.
* Version: 2.0.4
* Author: Edward McIntyre - @twittem
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Keybase proof

I hereby claim:

  • I am tareq1988 on github.
  • I am tareq (https://keybase.io/tareq) on keybase.
  • I have a public key whose fingerprint is 33CB 3E61 32F7 B56D 5D27 8825 156B 73B3 393D E189

To claim this, I am signing this object:

@tareq1988
tareq1988 / deploy.sh
Created June 27, 2014 15:35
WordPress plugin deploy to wp.org repository
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
@tareq1988
tareq1988 / relative-image-url.php
Created May 23, 2014 15:55
Relative image url
<?php
function wedevs_replace_image_url( $file ) {
if ( is_array( $file ) && isset( $file['src'] ) ) {
$file['src'] = str_replace( home_url(), '', $file['src'] );
}
return $file;
}
@tareq1988
tareq1988 / autoloader.php
Created January 31, 2014 18:47
Autoloader
<?php
/**
* Autoload class files on demand
*
* `Dokan_Installer` becomes => installer.php
* `Dokan_Template_Report` becomes => template-report.php
*
* @param string $class requested class name
*/