• I’m trying to Filter those three items of a Core function.

    $r = bbp_parse_args( $args, array(
    		'subscribe'   => __( 'Subscribe',   'bbpress' ),
    		'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
    		'before'      => ' | ',
    	), 'get_user_subscribe_link' );

    So I made this, as I don’t need the translation part.

    function shmoo_change_subs( $r ) {
    	$args = '';
    	$r = bbp_parse_args( $args, array(
    		'subscribe'   => 'test1',
    		'unsubscribe' => 'test2',
    		'user_id'     => 0,
    		'topic_id'    => 0,
    		'forum_id'    => 0,
    		'before'      => '',
    		'after'       => ''
    	), 'get_user_subscribe_link' );
    
    	return $r;
    }
    add_filter( 'bbp_get_user_subscribe_link', 'shmoo_change_subs' );

    But it results in this error msg,

    Notice: Array to string conversion in … blablabla

    I think the __( translation string ) from the source is the problem here. How do you surpass that ?

    I’m starting at making Filters and everything was going just fine till now.

  • The topic ‘Filter doesn't work at some array’ is closed to new replies.