Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Automatically add user topics to favorites


_ck_
Participant

@_ck_

Automatically adding a user’s new topic to their own favorites is as simple as this plugin. I’ve unhooked the notification plugin so users don’t get emailed for their own new topics starting.

<?php
/*
* Plugin Name: User Topics To Favorites
* Plugin Description: automatically adds new topics created by a user to their favorites
* Author: _ck_
* Author URI: http://CKon.wordpress.com
* Plugin URI: http://CKon.wordpress.com
* Version: 0.1
*/

function user_topics_to_favorites($topic_id) {
remove_action('bb_new_post', 'notification_new_post'); // don't email users about their new topic
$topic = get_topic( get_topic_id( $topic_id ) ); // fetch topic poster's id
bb_add_user_favorite( $topic->topic_poster, $topic_id );
}
add_action('bb_new_topic', 'user_topics_to_favorites');

?>

Skip to toolbar