Search Results for 'code'
-
Search Results
-
Topic: Topic icon
Topic: Navigation
Hello,
I’m developing a bbpress plugin and I have a task to execute on plugin activation.
I’ve seen that the bb_register_activation_hook functions is deprecated, while i can found the definition of the wp function: register_activation_hook.
however when i use this function inside a plugin, the function cannot be found.
What do I have to do?
here is the code:
<?php
/*
Plugin Name:XXX
Description:XXX
Version 1.0
*/
register_activation_hook(__FILE__, ‘mp_activation’);
register_deactivation_hook(__FILE__, ‘mp_deactivation’);
function mp_activation() {
…
}
function mp_deactivation() {
…
}
?>
Topic: Parent Forum Name in
I’m trying to get the parent forum name in the title tag.
I made a plug in that takes care of most of it…
<?php
/*
Plugin Name: Better Titles
Author: James Dixson
*/
add_filter('bb_title', 'titlemodify');
function titlemodify( $title ) {
//your code that does something to $title;
switch ( bb_get_location() ) {
case 'topic-page':
$title = get_topic_title() . ' - ' . get_forum_name() . ' — Adventure Canoe Forum' ;
break;
case 'front-page':
$title = bb_option('name') . ' — Canoeing and Paddling Discussion' ;
break;
case 'forum-page':
$find = 'Canoe';
$string = get_forum_name() ;
if(strstr($string,$find)){
$title = get_forum_name() . ' — Adventure Canoe Forum' ;
}else{
$title = 'Canoe ' . get_forum_name() . ' — Adventure Canoe Forum' ;
}
break;
}
return $title;
}
?>You can see it in action at http://www.adventurecanoe.com/forum
Now what I want to add is something that does this
Parent Forum Name — Forum Name — Forum Title
Basically if you went to the page http://www.adventurecanoe.com/forum/forum/rivers the title tag would read:
Canoeing Destinations — Rivers — Adventure Canoe Forum