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: Mfields Github Shortcode | |
| Plugin URI: null | |
| Description: Display recent commits from a Github repository. | |
| Version: 0.1 | |
| Author: Michael Fields | |
| Author URI: http://wordpress.mfields.org/ | |
| License: GPLv2 or later |
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
| -moz-user-select: none; | |
| -khtml-user-select: none; | |
| -webkit-user-select: none; | |
| user-select: none; |
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 | |
| // secure hashing of passwords using bcrypt, needs PHP 5.3+ | |
| // see http://codahale.com/how-to-safely-store-a-password/ | |
| // salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see http://php.net/crypt | |
| // just an example; please use something more secure/random than sha1(microtime) :) | |
| $salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22); | |
| // 2a is the bcrypt algorithm selector, see http://php.net/crypt |
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 | |
| /* | |
| * Use Taxonomy Images filter to get all speakers | |
| * associated with the current post. | |
| */ | |
| $speakers = apply_filters( 'taxonomy-images-get-the-terms', '', array( | |
| 'taxonomy' => 'category', | |
| ) ); |
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 | |
| /* | |
| * Send all required arguments. | |
| */ | |
| $test = new My_Object( array( | |
| 'one' => 1, | |
| 'two' => 2, | |
| 'three' => 3, |
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 | |
| /** | |
| * Enclose embedded media in a div. | |
| * | |
| * Wrapping all flash embeds in a div allows for easier | |
| * styling with CSS media queries. | |
| * | |
| * @todo Document parameters. | |
| * | |
| * @access private |
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
| /* Hide submit button if it exists. */ | |
| var button = document.getElementById( 'my_submit_button' ); | |
| if ( null !== button && 'style' in button && 'display' in button.style ) { | |
| button.style.display = 'none'; | |
| } |
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
| ( function( window, document, undefined ) { | |
| var maybeAddClass = function( e, cn ) { | |
| var c = e.getAttribute( 'class' ); | |
| if ( 0 == c.length ) { | |
| e.className += cn; | |
| } | |
| else if ( -1 == c.indexOf( cn ) ) { | |
| e.className += ' ' + cn; | |
| } |
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 | |
| $src = ''; | |
| $content = get_the_content(); | |
| /* Content contains only a url. */ | |
| $src = esc_url( trim( $content ) ); | |
| if ( ! empty( $src ) && is_array( @getimagesize( $src ) ) ) { |
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 | |
| // Register the column | |
| function price_column_register( $columns ) { | |
| $columns['price'] = __( 'Price', 'my-plugin' ); | |
| return $columns; | |
| } | |
| add_filter( 'manage_edit-post_columns', 'price_column_register' ); |