Forums
-
- Forum
- Posts
-
- Installation
- 27,752
- Troubleshooting
- 60,827
- Themes
- 10,195
- Plugins
- 15,006
- Requests & Feedback
- 14,660
- Showcase
- 3,238
-
From our fearless leader!
/*
Plugin Name: Recent Stickies
Author: Micheal Adams
Description: Adds a class to recent sticky posts
*/
function recent_sticky_class( $class, $topic_id ) {
$topic = get_topic( $topic_id );
if ( !$topic->topic_sticky )
return $class;
if ( get_topic_start_time( 'timestamp' ) < time() - 604800 )
return $class;
$class[] = 'recent-sticky';
return $class;
}
add_filter( 'topic_class', 'recent_sticky_class', 10, 2 );
Trent
See also: WordPress.org • bbPress.org • BuddyPress.org • Matt • Blog RSS