Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| //Add a custom admin dashboard welcome widget | |
| function custom_dashboard_widget() { | |
| echo '<h1>Welcome to your new WordPress site built by an awesome developer</h1>'; | |
| } | |
| function add_custom_dashboard_widget() { | |
| wp_add_dashboard_widget('custom_dashboard_widget', 'Integrity Welcomes You To WordPress!', 'custom_dashboard_widget'); | |
| } | |
| add_action('wp_dashboard_setup', 'add_custom_dashboard_widget'); | 
| <?php | |
| // Getting current blog_id | |
| global $wpdb, $current_blog; | |
| $id = $current_blog->blog_id; | |
| // Setting variable for current blog_prefix | |
| $blog_prefix = $wpdb->get_blog_prefix( $id ); | |
| // Start the BuddyPress Ajax Members Loop | |
| if ( bp_has_members( bp_ajax_querystring( 'members' ).'&meta_key='.$blog_prefix.'capabilities' ) ) : ?> | 
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| /* | |
| SCSS Color Methods for Accessibility | |
| ================================================================================ | |
| Adjust given colors to ensure that those color combination provide sufficient | |
| contrast. | |
| @version 0.1 | |
| @link http://eye48.com/go/scsscontrast | 
| // Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
| $('[placeholder]').focus(function() { | |
| var input = $(this); | |
| if (input.val() == input.attr('placeholder')) { | |
| input.val(''); | |
| input.removeClass('placeholder'); | |
| } | |
| }).blur(function() { | |
| var input = $(this); |