Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Last active August 29, 2015 14:19
Show Gist options
  • Save hellofromtonya/88a41477be7533abeadd to your computer and use it in GitHub Desktop.
Save hellofromtonya/88a41477be7533abeadd to your computer and use it in GitHub Desktop.
PHP Closure used as a hook callback for WordPress
<?php
/**
* Add class to the HTML Body tag
*
* @since 1.0.0
*
* @param array $classes
* @return array
*/
add_filter( 'body_class', function ( $classes ) {
$classes[] = 'wpdevsclub-school';
return $classes;
} );
/**
* Modify the Genesis Footer Credits
*
* @since 1.0.0
*
* @param string $credits
* @return string
*/
add_action( 'genesis_footer_creds_text', function( $credits ) {
return sprintf( '[footer_copyright after=" %s"] &#x000B7; All Rights Reserved &#x000B7; %s [footer_genesis_link url="http://www.studiopress.com/"] & [footer_wordpress_link] &#x000B7; <a href="http://wpdevelopersclub.com/go/siteground" target="_blank">%s</a>',
__( 'WP Developers Club', 'wpdevsclub' ),
__( 'Powered with <i class="fa fa-heart"></i> by ', 'wpdevsclub' ),
__( 'Hosted by <i class="fa fa-heart"></i> SiteGround ', 'wpdevsclub' )
);
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment