Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Remove ‘dash’ from forum description


chrishajer
Participant

@chrishajer

_ck_ – what if you wanted to use a different before character? I tried forum_description('before=x'); but that didn’t work. I couldn’t get before or after to work.

Can you explain how to use the arguments for that function please? Thanks.

function forum_description( $args = null ) {
if ( is_numeric($args) )
$args = array( 'id' => $args );
elseif ( $args && is_string($args) && false === strpos($args, '=') )
$args = array( 'before' => $args );
$defaults = array( 'id' => 0, 'before' => ' – ', 'after' => '' );
$args = wp_parse_args( $args, $defaults );

if ( $desc = apply_filters( 'forum_description', get_forum_description( $args['id'] ), $args['id'], $args ) )
echo $args['before'] . $desc . $args['after'];

 

It seems like the relevant info is listed right there in the $defaults array, but I couldn’t stumble upon the combination to make it work.

Skip to toolbar