This file contains 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: Snippets Shortcode | |
* Plugin URI: http://wordpress.stackexchange.com/q/116044/12615 | |
* Description: Add code snippets as a Custom Post Type. Display in regular posts and pages using a Shortcode. Rendered with Google Prettify in frontend. | |
* Version: 1.0 | |
* Author: Rodolfo Buaiz | |
* Author URI: http://brasofilo.com | |
* License: GPLv2 or later | |
* |
This file contains 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 | |
# Load slim WP | |
define( 'WP_USE_THEMES', false ); | |
require( './wp-load.php' ); | |
# http://phpexcel.codeplex.com/ | |
require_once dirname(__FILE__) . '/Classes/PHPExcel.php'; | |
global $wpdb; | |
$query = "SELECT * FROM $wpdb->comments |
This file contains 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_filter( 'widget_title', function( $title ) | |
{ | |
$pieces = explode( '||', $title ); | |
if( isset( $pieces[1] ) ) | |
{ | |
$target = isset( $pieces[2] ) ? "target='{$pieces[2]}'" : ''; | |
$new_title = sprintf( | |
"<a href='%s' %s>%s</a>", | |
$pieces[1], |
This file contains 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
html, body { | |
min-height: 100%; | |
} | |
body { | |
background: #d8e0de; | |
background: -moz-linear-gradient(top, #d8e0de 0%, #aebfbc 22%, #99afab 33%, #8ea6a2 50%, #829d98 67%, #4e5c5a 82%, #0e0e0e 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#d8e0de), color-stop(22%,#aebfbc), color-stop(33%,#99afab), color-stop(50%,#8ea6a2), color-stop(67%,#829d98), color-stop(82%,#4e5c5a), color-stop(100%,#0e0e0e)); | |
background: -webkit-linear-gradient(top, #d8e0de 0%,#aebfbc 22%,#99afab 33%,#8ea6a2 50%,#829d98 67%,#4e5c5a 82%,#0e0e0e 100%); | |
background: -o-linear-gradient(top, #d8e0de 0%,#aebfbc 22%,#99afab 33%,#8ea6a2 50%,#829d98 67%,#4e5c5a 82%,#0e0e0e 100%); | |
background: -ms-linear-gradient(top, #d8e0de 0%,#aebfbc 22%,#99afab 33%,#8ea6a2 50%,#829d98 67%,#4e5c5a 82%,#0e0e0e 100%); |
This file contains 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: Multisite Site Category | |
* Plugin URI: https://gist.github.com/brasofilo/6715423 | |
* Description: Add a custom meta option when registering new sites in WordPress Multisite. Two columns will be added to the Sites listing screen: ID and Category. Based on http://wordpress.stackexchange.com/a/50936/12615 | |
* Network: true | |
* Author: Rodolfo Buaiz | |
* Author URI: http://brasofilo.com/ | |
* Version: 1.1 |
This file contains 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: Calculate Folders Sizes | |
* Plugin URI: http://wordpress.org/extend/plugins/many-tips-together | |
* Description: Dashboard widgets to calculate the size of the folders in root and wp-content. Used in the plugin Admin Tweaks. | |
* Version: 1.0 | |
* Author: Rodolfo Buaiz | |
* Author URI: http://brasofilo.com/ | |
* Text Domain: mtt | |
* License: GPLv2 or later |
This file contains 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 | |
/** | |
* Custom browser check | |
* | |
* Uses https://github.com/cbschuld/Browser.php | |
*/ | |
function b5f_browser_check($what) { | |
global $browser, $browver; | |
switch ($what) { |
This file contains 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: Settings API based on User ID | |
*/ | |
class MySettingsPage2 | |
{ | |
/** | |
* Holds the values to be used in the fields callbacks | |
*/ |
This file contains 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
<input type="text" name="my-theme-options[color]" id="color" /> | |
<input type='button' class='pickcolor button-secondary' value='Select Color'> | |
<div id='colorpicker' style='z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;'></div> | |
// Color Picker for js file | |
$('.pickcolor').click( function(e) { | |
colorPicker = jQuery(this).next('div'); | |
input = jQuery(this).prev('input'); | |
$(colorPicker).farbtastic(input); | |
colorPicker.show(); |