'', 'after' => '', 'text' => __( 'RSS', 'cakifo' ), ), $atts ) ); return $before . '' . $text . '' . $after; } /** * Twitter username and/or link to profile. * * Taken from my Twitter Profile Field plugin * * @link (http://wordpress.org/extend/plugins/twitter-profile-field/, Twitter Profile Field) * @param array $atts * @return string The Twitter username or username with a link to the profile. * @since Cakifo 1.0 */ function cakifo_twitter_shortcode( $atts ) { extract( shortcode_atts( array( 'link' => true, 'before' => '', 'after' => '', 'username' => hybrid_get_setting( 'twitter_username' ), 'text' => __( 'Follow me on Twitter', 'cakifo' ) ), $atts ) ); if ( empty( $username ) ) return; if ( ! $link ) return $username; else return $before . '' . $text . '' . $after; } /** * Delicious link shortcode * * @param array $atts * @since Cakifo 1.0 */ function cakifo_entry_delicious_link_shortcode( $atts ) { extract( shortcode_atts( array( 'before' => '', 'after' => '', ), $atts) ); return $before . '' . __( 'Delicious', 'cakifo' ) . '' . $after; } /** * Digg link shortcode * * @note This won't work from your computer (http://localhost). Must be a live site. * * @param array $atts * @since Cakifo 1.0 */ function cakifo_entry_digg_link_shortcode( $atts ) { extract( shortcode_atts( array( 'before' => '', 'after' => '', ), $atts) ); $url = 'http://digg.com/submit?phase=2&url=' . urlencode( get_permalink( get_the_ID() ) ) . '&title="' . urlencode( the_title_attribute( 'echo=0' ) ); return $before . '' . __( 'Digg', 'cakifo' ) . '' . $after; } /** * Facebook share link shortcode. * * @note This won't work from your computer (http://localhost). Must be a live site. * @link http://developers.facebook.com/docs/reference/plugins/like/ * * @param array $atts * @since Cakifo 1.0 */ function cakifo_entry_facebook_link_shortcode( $atts ) { static $first = true; extract( shortcode_atts( array( 'before' => '', 'after' => '', 'href' => get_permalink(), 'layout' => 'standard', // standard, button_count, box_count 'action' => 'like', // like, recommend 'width' => 450, 'faces' => 'false', // true, false 'colorscheme' => 'light', // light, dark 'locale' => get_locale(), // Language of the button - ex: da_DK, fr_FR ), $atts) ); // Set default locale $locale = ( isset( $locale ) ) ? $locale : 'en_US'; // Only add the script once $script = ( $first == true ) ? "" : ""; $first = false; $text = '
'; return $before . $text . $after . $script; } /** * Twitter link shortcode * * @param array $atts * @since Cakifo 1.0 */ function cakifo_entry_twitter_link_shortcode( $atts ) { extract( shortcode_atts( array( 'before' => '', 'after' => '', 'href' => get_permalink(), 'text' => the_title_attribute( 'echo=0' ), 'layout' => 'horizontal', // horizontal, vertical, none 'via' => hybrid_get_setting( 'twitter_username' ), 'width' => 55, // Only need to use if there's no add_theme_support( 'cakifo-twitter-button' ) 'height' => 20, // Only need to use if there's no add_theme_support( 'cakifo-twitter-button' ) ), $atts) ); // Load the PHP tweet button script if the theme supports it if ( current_theme_supports( 'cakifo-twitter-button' ) ) : return cakifo_tweet_button( array( 'before' => $before, 'after' => $after, 'layout' => $layout, 'href' => $href, 'text' => $text, 'layout' => $layout, 'via' => $via, ) ); // Else, load the Twitter iframe else : // Set the height to 62px if the layout is vertical and the height is the default value if ( $layout == 'vertical' && $height == 20 ) $height = 62; // Set width to 110px if the layout is horizontal and the width is the default value if ( $layout == 'horizontal' && $width == 55 ) $width = 110; // Build the query $query_args = array( 'url' => $href, 'via' => esc_attr( $via ), 'text' => esc_attr( $text ), 'count' => esc_attr( $layout ) ); return $before . '' . $after; endif; } /** * Google +1 shortcode * * @link (http://www.google.com/+1/button/, Google+ button) * @param array $atts * @since Cakifo 1.2 */ function cakifo_entry_googleplus_link_shortcode( $atts ) { static $first = true; extract( shortcode_atts( array( 'before' => '', 'after' => '', 'href' => get_permalink(), 'layout' => 'standard', // small, medium, standard, tall 'callback' => '', 'count' => 'true' // true, false ), $atts) ); // Only add the script once $script = ( $first == true ) ? "" : ""; $first = false; $text = ''; return $before . $text . $after . $script; } /** * Displays the published date of an individual post in HTML5 format. * * It replaces the default Hybrid Core shortcode. The name is still the the same * * @param array $atts * @since Cakifo 1.1 */ function cakifo_entry_published_shortcode( $atts ) { $atts = shortcode_atts( array( 'before' => '', 'after' => '', 'format' => get_option( 'date_format' ), 'pubdate' => true, ), $atts ); // Pubdate attribute can be removed with [entry-published pubdate="something"] $pubdate = ( $atts['pubdate'] === true ) ? 'pubdate' : ''; $published = ''; return $atts['before'] . $published . $atts['after']; } /** * Displays the published date of an individual comment in HTML5 format. * * It replaces the default Hybrid Core shortcode. The name is still the the same * * @param array $atts * @since Cakifo 1.1 */ function cakifo_comment_published_shortcode( $atts ) { $atts = shortcode_atts( array( 'before' => '', 'after' => '' ), $atts ); $published = ''; return $atts['before'] . $published . $atts['after']; } /** * Displays an individual post's author with a link to his or her archive. * * It replaces the default Hybrid Core shortcode. The name is still the the same * * @param array $atts * @since Cakifo 1.3 */ function cakifo_entry_author_shortcode( $atts ) { $atts = shortcode_atts( array( 'rel' => 'author', 'before' => '', 'after' => '', ), $atts ); $author = ''; return $atts['before'] . $author . $atts['after']; } /** * Displays the post format of the current post * * @param array $atts * @since Cakifo 1.3 */ function cakifo_entry_format_shortcode( $atts ) { $atts = shortcode_atts( array( 'before' => '', 'after' => '' ), $atts ); return $atts['before'] . get_post_format() . $atts['after']; } ?>