' . __( 'Shortlink', 'news' ) . ''; $out .= '
'; return $out; } /** * Print link shortcode. * * @since 0.1.0 */ function news_entry_print_link_shortcode() { return '' . __( 'Print', 'news' ) . ''; } /** * Email link shortcode. * * @since 0.1.0 */ function news_entry_email_link_shortcode() { $subject = urlencode( esc_attr( '[' . get_bloginfo( 'name' ) . ']' . the_title_attribute( 'echo=0' ) ) ); $body = urlencode( esc_attr( sprintf( __( 'Check out this post: %1$s', 'news' ), get_permalink( get_the_ID() ) ) ) ); return '' . __( 'Email', 'news' ) . ''; } /** * Mixx link shortcode. * * @since 0.1.0 */ function news_entry_mixx_link_shortcode() { return '' . __( 'Mixx', 'news' ) . ''; } /** * Delicious link shortcode. * * @since 0.1.0 */ function news_entry_delicious_link_shortcode() { return '' . __( 'Delicious', 'news' ) . ''; } /** * Digg link shortcode. * @note This won't work from your computer (http://localhost). Must be a live site. * * @since 0.1.0 */ function news_entry_digg_link_shortcode() { $url = esc_url( 'http://digg.com/submit?phase=2&url=' . urlencode( get_permalink( get_the_ID() ) ) . '&title="' . urlencode( the_title_attribute( 'echo=0' ) ) ); return 'Digg'; } /** * Facebook share link shortcode. * * @todo Figure out why this doesn't work. * * @since 0.1.0 */ function news_entry_facebook_link_shortcode() { $url = esc_url( 'http://facebook.com/sharer.php?u=' . urlencode( get_permalink( get_the_ID() ) ) . '&t=' . urlencode( the_title_attribute( 'echo=0' ) ) ); return '' . __( 'Facebook', 'news' ) . ''; } /** * Twitter link shortcode. * * @since 0.1.0 */ function news_entry_twitter_link_shortcode() { $post_id = get_the_ID(); $post_type = get_post_type( $post_id ); if ( 'post' == $post_type || 'page' == $post_type || 'attachment' == $post_type ) $shortlink = wp_get_shortlink( $post_id ); else $shortlink = get_permalink( $post_id ); $url = esc_url( 'http://twitter.com/home?status=' . urlencode( sprintf( __( 'Currently reading %1$s', 'news' ), $shortlink ) ) ); return '' . __( 'Twitter', 'news' ) . ''; } /** * Slideshow shortcode. * * @since 0.1.0 */ function news_slideshow_shortcode( $attr ) { global $post; /* Set up the defaults for the slideshow shortcode. */ $defaults = array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'size' => 'news-slideshow', 'include' => '', 'exclude' => '', 'numberposts' => -1, ); $attr = shortcode_atts( $defaults, $attr ); /* Allow users to overwrite the default args. */ extract( apply_atomic( 'slideshow_shortcode_args', $attr ) ); /* Arguments for get_children(). */ $children = array( 'post_parent' => intval( $id ), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'exclude' => absint( $exclude ), 'include' => absint( $include ), 'numberposts' => intval( $numberposts ), ); /* Get image attachments. If none, return. */ $attachments = get_children( $children ); if ( empty( $attachments ) ) return ''; /* If is feed, leave the default WP settings. We're only worried about on-site presentation. */ if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $id => $attachment ) $output .= wp_get_attachment_link( $id, $size, true ) . "\n"; return $output; } $slideshow = ''; return apply_atomic( 'slideshow_shortcode', $slideshow ); } ?>