Created
September 6, 2013 18:39
-
-
Save msenateatplos/6468105 to your computer and use it in GitHub Desktop.
a couple little filter snippets to expose some ppt permalinks, not quite desirable functionality yet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'add_key_to_the_permalink' ) ) : | |
/** | |
* Try to automate using the special key by adding to permalink | |
*/ | |
function add_key_to_the_permalink($permalink_url) { | |
global $post; | |
if ($post->post_status == 'publish' && !empty($post->post_password)) : | |
$permalink_url = ppt_make_permalink($post); | |
endif; | |
return $permalink_url; | |
} | |
add_filter('the_permalink', 'add_key_to_the_permalink'); | |
endif; | |
if ( ! function_exists( 'hum_edboard_posted_on' ) ) : | |
/** | |
* Prints HTML with meta information for the current post-date/time and author. | |
* Create your own twentyeleven_posted_on to override in a child theme | |
* | |
* @since Twenty Eleven 1.0 | |
*/ | |
function hum_edboard_posted_on() { | |
echo '<span class="sep">Posted on </span><a href="'; | |
esc_url(the_permalink()); | |
printf( __( '" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ), | |
esc_url( get_permalink() ), | |
esc_attr( get_the_time() ), | |
esc_attr( get_the_date( 'c' ) ), | |
esc_html( get_the_date() ), | |
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), | |
esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), | |
get_the_author() | |
); | |
} | |
endif; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment