Skip to content

Instantly share code, notes, and snippets.

<?php
if ( ! defined( 'ABSPATH' ) ) exit;
class Code_Snippet_Library {
private $dir;
private $file;
private $assets_dir;
private $assets_url;
@bryanwillis
bryanwillis / functions.php
Created March 24, 2014 18:29 — forked from xymox12/functions.php
Tinymce toolbars for different post types
/* Tiny MCE Modifications */
function myformatTinyMCE($in) {
$style_formats = array(
array(
'title' => 'First paragraph',
'selector' => 'p',
'classes' => 'standFirst'
/***
*JQuery Highlight
*http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
***/
jQuery.extend({highlight:function(a,j,g,f){if(a.nodeType===3){var d=a.data.match(j);if(d){var b=document.createElement(g||"span");b.className=f||"highlight";var h=a.splitText(d.index);h.splitText(d[0].length);var e=h.cloneNode(true);b.appendChild(e);h.parentNode.replaceChild(b,h);return 1}}else{if((a.nodeType===1&&a.childNodes)&&!/(script|style)/i.test(a.tagName)&&!(a.tagName===g.toUpperCase()&&a.className===f)){for(var c=0;c<a.childNodes.length;c++){c+=jQuery.highlight(a.childNodes[c],j,g,f)}}}return 0}});jQuery.fn.unhighlight=function(a){var b={className:"highlight",element:"span"};jQuery.extend(b,a);return this.find(b.element+"."+b.className).each(function(){var c=this.parentNode;c.replaceChild(this.firstChild,this);c.normalize()}).end()};jQuery.fn.highlight=function(f,b){var d={className:"highlight",element:"span",caseSensitive:false,wordsOnly:false};jQuery.extend(d
<span class="user-avatar-image"><?php global $current_user; get_currentuserinfo(); echo get_avatar( $current_user->ID, 64 ); ?><
span>
--
-- OCR all documents added to a folder
--
on adding folder items to this_folder after receiving added_items
try
repeat with i from 1 to number of items in added_items
set this_item to item i of added_items
set appName to my getAppName()
tell application appName
activate
@bryanwillis
bryanwillis / print_all_admin_menus.php
Created June 6, 2014 03:49
Show all the admin menus in an array for developing purposes
function edit_admin_menus() {
global $submenu, $menu, $pagenow;
if( $pagenow == 'index.php' ) {
echo '<pre>'; print_r( $menu ); echo '</pre>';
echo '<pre>'; print_r( $submenu ); echo '</pre>';
}
}
add_action( 'admin_notices', 'edit_admin_menus' );
![Alt text](https://lh3.googleusercontent.com/-vt7w5CBihqo/U5L17_VKUhI/AAAAAAAACsA/xhH_Lv-vTec/w1856-h1210-no/Screen+Shot+2014-06-07+at+5.00.03+AM.png "Optional title")
* The elements in the array are :
* 0: Menu item name
* 1: Minimum level or capability required.
* 2: The URL of the item's file
* 3: Class
* 4: ID
* 5: Icon for top level menu
* @global array $menu
<?php
// ADD THIS TO YOUR CHILD THEMES FUNCTIONS.PHP
remove_action( 'genesis_site_title', 'genesis_remove_site_title' );
add_action( 'genesis_site_title', 'child_genesis_add_site_title' );
function child_genesis_add_site_title() {
?>
<?php if ( get_theme_mod( 'child_genesis_logo' ) ) : ?>
<h1 itemprop="headline" class='site-title'><a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>' rel='home'><img src='<?php echo esc_url( get_theme_mod( 'child_genesis_logo' ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'></a></h1>
<?php
/*
* Plugin Name: Export Nav Menus Wodprerss Exporter
* Plugin URI: http://candidbusiness.com/
* Description: Export/Import Menus Only From Wordpress Export
* Version: 1.0.0
*/
function add_mav_menu_to_export() {
$post_type = get_post_type_object('nav_menu_item');