This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$terms = get_terms('publicationyear','order=ASC'); | |
// | |
function cmp($a, $b) { | |
return $b < $a; | |
} | |
usort($terms, "cmp"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress Bootstrap Pagination | |
*/ | |
function wp_bootstrap_pagination( $args = array() ) { | |
$defaults = array( | |
'range' => 4, | |
'custom_query' => FALSE, | |
'previous_string' => __( 'Previous', 'text-domain' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add to existing function.php file | |
// Disable support for comments and trackbacks in post types | |
function df_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
if(post_type_supports($post_type, 'comments')) { | |
remove_post_type_support($post_type, 'comments'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* 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() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress Chosen Taxonomy Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* Use Chosen for a replacement taxonomy metabox in WordPress | |
* Useful for taxonomies that aren't changed much on the fly and are | |
* non-hierarchical in nature, as Chosen is for flat selection only. | |
* You can always use the taxonomy admin screen to add/edit taxonomy terms. | |
* Categories need slightly different treatment from the rest in order to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('admin_init', 'add_meta_boxes', 1); | |
function add_meta_boxes() { | |
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high'); | |
} | |
function repeatable_meta_box_display() { | |
global $post; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('admin_init', 'add_meta_boxes', 1); | |
function add_meta_boxes() { | |
add_meta_box( 'repeatable-fields', 'Product List', 'repeatable_meta_box_display', 'post', 'normal', 'high'); | |
} | |
function get_product($value, $isHidden = false) { | |
return ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Nama_Widget_Classes extends WP_Widget { | |
/*--------------------------------------------------*/ | |
/* Constructor | |
/*--------------------------------------------------*/ | |
/** | |
* Specifies the classname and description, instantiates the widget, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* | |
Plugin Name: WP Plugin Autoloader | |
Plugin URI: http://www.caavadesign.com | |
Description: Proposed usage of a WP autoloader | |
Version: 0.0.1 | |
Author: Brandon Lavigne | |
*/ | |
# Plugin Autoloader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function generate_icon_array() { | |
$icons = get_option( 'fa_icons' ); | |
if ( ! $icons ) { | |
$pattern = '/\.(fa-(?:\w+(?:-)?)+):before\s+{\s*content:\s*"(.+)";\s+}/'; | |
$subject = file_get_contents( FA_DIR . 'css/font-awesome/css/font-awesome.css' ); | |
preg_match_all( $pattern, $subject, $matches, PREG_SET_ORDER ); | |
$icons = array(); | |
foreach ( $matches as $match ) { | |
$icons[] = array( 'css' => $match[2], 'class' => stripslashes( $match[1] ) ); | |
} |
OlderNewer