Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function live_blogging_get_entry($entry)
- {
- $style = get_option('liveblogging_style');
- $style = preg_replace(
- '/\$DATE/',
- get_the_time(get_option('liveblogging_date_style'), $entry),
- $style
- );
- // Remove content hooks
- $unhooks = get_option('liveblogging_unhooks');
- if (!empty($unhooks))
- {
- foreach ($unhooks as $unhook)
- {
- $unhook = explode( ',' , $unhook, 2 );
- $unhook = array_map( 'trim', $unhook );
- $count = count( $unhook );
- switch( $count ) {
- case 2:
- if ( method_exists( $GLOBALS[$unhook[0]], $unhook[1]))
- {
- remove_filter('the_content', array($GLOBALS[$unhook[0]], $unhook[1]));
- }
- break;
- case 1:
- default:
- if ( function_exists($unhook[0]))
- {
- remove_filter('the_content', $unhook[0]);
- }
- break;
- }
- }
- }
- $style = preg_replace(
- '/\$CONTENT/',
- apply_filters('the_content', $entry->post_content),
- $style);
- // Add content back in hooks
- if (!empty($unhooks))
- {
- foreach ($unhooks as $unhook)
- {
- $unhook = explode( ',' , $unhook, 2 );
- $unhook = array_map( 'trim', $unhook );
- $count = count( $unhook );
- switch( $count ) {
- case 2:
- if ( method_exists( $GLOBALS[$unhook[0]], $unhook[1]))
- {
- add_filter('the_content', array($GLOBALS[$unhook[0]], $unhook[1]));
- }
- break;
- case 1:
- default:
- if ( function_exists($unhook[0]))
- {
- add_filter('the_content', $unhook[0]);
- }
- break;
- }
- }
- }
- $user = get_userdata($entry->post_author);
- $style = preg_replace(
- '/\$AUTHOR/',
- apply_filters('the_author', $user->display_name),
- $style
- );
- return $style;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement