Skip to content

Instantly share code, notes, and snippets.

@rfmeier
Last active January 19, 2016 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfmeier/5672679 to your computer and use it in GitHub Desktop.
Save rfmeier/5672679 to your computer and use it in GitHub Desktop.
Alter the sharedaddy box title.
<?php
//* do not include php tags
add_filter( 'sharedaddy_box_title', 'custom_sharedaddy_box_title', 10, 2 );
/**
* Callback for RFMeier-Genesis 'sharedaddy_box_title' filter.
*
* Alter the sharedaddy box title.
*
* @since 0.2
* @author Ryan Meier <rfmeier@gmail.com>
*
* @param string $title The current sharedaddy box title
* @param object $post The current post object within the loop
* @return string $title The current sharedaddy box title
*/
function custom_sharedaddy_box_title( $title, $post ){
//* use modular arthimetic
$rem = $post->ID % 3;
//* determine the title by the remainder
switch ( $rem ) {
case 1:
$title = __( 'Share it! Share it good!' );
break;
case 2:
$title = __( 'Share this with the world.' );
break;
default:
break;
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment