Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

pramodjodhani

🏠
Working from home
View GitHub Profile
View disable_woothumbs.php
<?php
/**
* Disable WooThumbs to prevent duplicate gallery.
*
* @return void
*/
function iconic_disable_woothumbs() {
global $iconic_woothumbs_class;
remove_action( 'woocommerce_before_single_product_summary', array( $iconic_woothumbs_class, 'show_product_images' ), 20 );
@pramodjodhani
pramodjodhani / regex_list_functions.php
Created Feb 13, 2020
List all the functions in current directory
View regex_list_functions.php
<?php
$functions = [];
foreach( glob("./{,*/,*/*/,*/*/*/}*.php" , GLOB_BRACE ) as $file ) {
$matches = [];
$content = file_get_contents( $file );
preg_match_all( "/function\s(.*)\(/", $content, $matches );
View php_display_errors.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
View set_featured_image.php
@pramodjodhani
pramodjodhani / functions.php
Created Apr 13, 2015
ACF Pro - add options page
View functions.php
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Zip Codes',
'menu_title' => 'Zip Codes',
'menu_slug' => 'zip-codes',
'capability' => 'manage_options',
'redirect' => false
));
@pramodjodhani
pramodjodhani / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.