Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wptumble_show_read_more( $content = '', $topic_id = 0, $args = array() ) {
- global $bbp;
- global $mar_options;
- //default arguments
- $defaults = array(
- 'separator' => '<hr />',
- 'before' => '<div class="wptumble-mark-as-read">',
- 'after' => '</div>'
- );
- $r = wp_parse_args( $args, $defaults );
- extract( $r );
- //verify topic id, get author id, and mark as read
- $topic_id = bbp_get_topic_id ( $topic_id );
- $user_id = bbp_get_topic_author_id ( $topic_id );
- if(bbp_is_single_topic() && get_post_type() == 'topic' && $mar_options['show_links'] == true) {
- if($mar_options['post_position'] == 'Top') {
- $content = mar_read_unread_links($mar_options[ 'read_text' ], $mar_options[ 'unread_text' ]) . $separator . $before . $content . $after;
- } else {
- $content = $content . $separator . $before . mar_read_unread_links($mar_options[ 'read_text' ], $mar_options[ 'unread_text' ]) . $after;
- }
- }
- return apply_filters( 'wptumble_show_read_more', $content, $topic_id, $separator );
- }
- if ( !is_admin() ) {
- add_filter( 'bbp_get_topic_content', 'wptumble_show_read_more', 1, 2 );
- add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions', 1, 4 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement