Skip to content

Instantly share code, notes, and snippets.

View azizultex's full-sized avatar
🌍
Working from anywhere 😊

Azizul Haque azizultex

🌍
Working from anywhere 😊
View GitHub Profile
@azizultex
azizultex / Ajax FrontEnd File Upload WordPress With Preview
Created January 12, 2017 17:17
Ajax FrontEnd File Upload WordPress With Preview
/****************************************************************
Project: MySavingWallet
Resource: http://www.ibenic.com/wordpress-file-upload-with-ajax/
HTML FORM
*****************************************************************/
<dt><?php esc_html_e( 'Support Doc', 'listify_child' ); ?></dt>
<dd>
<section>
@azizultex
azizultex / Google Map API for WordPress Site
Created January 4, 2017 16:51
Google Map API for WordPress Site
function escaperoom_googlemap_api_key($url, $original_url, $_context) {
$key = 'AIzaSyAWQTIcIfpsttvugW18F1y14p8gbFXmtXE'; // your map api key
// If no key added no point in checking
if ( ! $key ) {
return $url;
}
if ( strstr( $url, "maps.google.com/maps/api/js" ) !== false || strstr( $url, "maps.googleapis.com/maps/api/js" ) !== false ) {// it's a Google maps url
@azizultex
azizultex / Get WooCommerce Large Images list from Gallery
Last active November 23, 2016 16:15
Get WooCommerce Large Images list from Gallery
@azizultex
azizultex / Change slug ( add_rewrite_rule ) of already registered taxonomy or custom post type
Last active January 4, 2022 14:09
Change slug ( add_rewrite_rule ) of already registered taxonomy or custom post type
/***************************************************
USING add_rewrite_rule
****************************************************/
/* azizultex
1. https://www.ait-themes.club/knowledge-base/how-can-i-change-items-slug-and-slug-of-other-custom-post-types/
2. http://wordpress.stackexchange.com/questions/41988/redeclare-change-slug-of-a-plugins-custom-post-type
3. http://wordpress.stackexchange.com/questions/134322/rewrite-rule-for-custom-taxonomy
*/
@azizultex
azizultex / Clean a multidimensional array from null, 0, empty string
Last active August 19, 2016 05:09
Clean a multidimensional array from null, 0, empty string
/* https://rogerpadilla.wordpress.com/2009/08/21/remove-empty-items-from-array/ */
function array_non_empty_items($input) {
if (!is_array($input)) {
return $input;
}
$non_empty_items = array();
foreach($input as $key => $value) {
if ($value) {
$non_empty_items[$key] = array_non_empty_items($value);
}
@azizultex
azizultex / Kirki demo settings
Created July 26, 2016 11:31
Kirki demo settings
function superminimal_demo_panels_sections( $wp_customize ) {
/**
* Add Panel
*/
$wp_customize->add_panel( 'sitepoint_demo_panel', array(
'priority' => 10,
'title' => __( 'SitePoint Demo Panel', 'superminimal' ),
'description' => __( 'Kirki integration for SitePoint demo', 'superminimal' ),
) );
@azizultex
azizultex / Custom Class to Slick Carousel Next Prev Items and animation
Last active May 10, 2023 05:07
Custom Class to Slick Carousel Next Prev Items and animation
@azizultex
azizultex / Register a new string WPML
Created July 6, 2016 04:25
Register a new string WPML
if(function_exists('icl_register_string')) {
icl_register_string ( 'Quovim', 'Copyright', $copyright );
}
if(function_exists('icl_translate')) {
$copyright = icl_translate( 'Quovim', 'Copyright', $copyright );
}
echo $copyright;
@azizultex
azizultex / Ajax loading image gallery WordPress
Last active July 7, 2023 03:06
Ajax loading image gallery WordPress ( coded for oliveorange.com )
@azizultex
azizultex / Install PHP Postgre PDO driver
Created June 25, 2016 17:25
Install PHP Postgre PDO driver
// Method 1
brew install php56-pdo-pgsql
// Method 2
#!/bin/bash
# Check PHP version `php --version`
PHP_VER=$(php -v | head -1 | awk '{ print $2 }')