Skip to content

Instantly share code, notes, and snippets.

View hsleonis's full-sized avatar
🏝️
Travellers unite.

Hasan Shahriar hsleonis

🏝️
Travellers unite.
View GitHub Profile
@hsleonis
hsleonis / woocommerce-optimize-scripts.php
Created April 22, 2018 06:13 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@hsleonis
hsleonis / image-sizes-extd.php
Created January 24, 2017 18:29 — forked from franz-josef-kaiser/image-sizes-extd.php
Altering & handling default and custom wordpress image sizes and related stuff
<?php
defined( 'ABSPATH' ) OR exit;
add_action( 'init', array( 'oxoImageSizesExtd', 'init' ), 0 );
class oxoImageSizesExtd extends oxoImageSizes
{
/**
* The Class Object
* @var
@hsleonis
hsleonis / limit_admin_post_list_fields.php
Created January 24, 2017 18:19 — forked from franz-josef-kaiser/limit_admin_post_list_fields.php
Speed up the post list views in WordPress admin UI screens. Reduce the queried fields to what is needed to display the posts and what "Quick Edit" needs. Saved time increases with a higher limit set for `posts_per_screen` in the screen options drop down.
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) Faster Admin Post Lists
* Description: Reduces the queried fields inside WP_Query for WP_Post_List_Table screens
* Author: Franz Josef Kaiser <wecodemore@gmail.com>
* AuthorURL: http://unserkaiser.com
* License: MIT
*/
@hsleonis
hsleonis / array_remove.js
Created March 31, 2016 11:26 — forked from HiveSolution/array_remove.js
Simple prototype ext. for array to remove elements
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
@hsleonis
hsleonis / select-without-expand.scss
Created March 31, 2016 10:49 — forked from delphinpro/select-without-expand.scss
Remove expand arrow in select-element
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
&::-ms-expand { display: none; }
}