Skip to content

Instantly share code, notes, and snippets.

View hchouhan's full-sized avatar
💡
Thinking

Harish Chouhan hchouhan

💡
Thinking
View GitHub Profile
@hchouhan
hchouhan / top-10
Created September 28, 2013 08:23
Top 10 Posts
Shortcode
[irt_top_posts post_type='showcase' container='div' number='10']
function dot_irt_top_posts ( $atts ) {
// get our variable from $atts
extract(shortcode_atts(array(
'container' => 'li',
'number' => '10',
'post_type' => 'post',
@hchouhan
hchouhan / MPI - Complete Code
Last active August 30, 2018 18:06
MPI - Complete Code
<?php
/*
Plugin Name: My Plugin Information
Plugin URI: http://wp.tutsplus.com
Description: Communicate with WordPress.org Plugins API to retrive your Plugin Information
Version: 0.1
Author: Harish
Author Email: [email protected]
License:
@hchouhan
hchouhan / MPI - Base
Last active December 24, 2015 09:19
MPI - Base
[php]
<?php
/*
Plugin Name: My Plugin Info
Plugin URI: http://myplugininfo.com
Description: Communicate with WordPress.org Plugins API to retrive your Plugin Information
Version: 0.1
Author: Harish
Author Email: [email protected]
License: GPL3
@hchouhan
hchouhan / MPI - 2
Created October 1, 2013 14:26
MPI - 2
[php]
// get our variable from $atts
extract(shortcode_atts(array(
'slug' => '', //foo is a default value
'field' => ''
), $atts));
[/php]
@hchouhan
hchouhan / MPI - 3
Created October 1, 2013 14:30
MPI - 3
[php]
/**
* Check if slug exists
*/
if ( !$slug ) {
return false;
}
/**
[php]
<?php
/*
Plugin Name: My Plugin Information
Plugin URI: http://wp.tutsplus.com
Description: Communicate with WordPress.org Plugins API to retrive your Plugin Information
Version: 0.1.1
Author: Harish
Author Email: [email protected]
License:
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
/**
* Borrowed from https://github.com/addyosmani/jquery-ui-bootstrap
* Styles the datepicker popup for gravityforms used with bootstrap
*/
/*
* jQuery UI Datepicker
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
@hchouhan
hchouhan / MPI - 01
Created October 3, 2013 06:48
MPI - 01
<?php
/*
Plugin Name: My Plugin Info
Plugin URI: http://myplugininfo.com
Description: Communicate with WordPress.org Plugins API to retrive your Plugin Information
Version: 0.1
Author: Harish
Author Email: [email protected]
License: GPL3
*/
@hchouhan
hchouhan / MPI - 02
Created October 3, 2013 06:50
MPI - 02
/**
* Check if slug exists
*/
if ( ! $slug ) {
return false;
}
/**
* Check if field exists
* Return value based on the field attribute