Editing a function in a plugin – add_action or add_filter
-
Hi,
I am trying to write a plugin and I do not know how can I do it properly.
The plugin I am working on requires the editing of the “get_forum_link” function, specifically the “$link ” vatiable.
I have the code done in php but do not know how to make a plugin out of it. What and how should I use add_action or add_filter?
Thanx.
function get_forum_link( $forum_id = 0, $page = 1 ) {
global $forum;
if ( $forum_id )
$forum = get_forum( $forum_id );
if ( bb_get_option( ‘mod_rewrite’ ) )
$link = bb_get_option( ‘uri’ ) . “forum/$forum->forum_id” . ( 1 < $page ? “/page/$page” : ” );
else {
$args = array();
$link = bb_get_option( ‘uri’ ) . ‘forum.php’;
$args = $forum->forum_id;
$args = 1 < $page ? $page : ”;
$link = add_query_arg( $args, $link );
}
return apply_filters( ‘get_forum_link’, $link, $forum->forum_id );
}
- You must be logged in to reply to this topic.