Skip to:
Content
Pages
Categories
Search
Top
Bottom

Bug in subscribe button


  • gperez-tl
    Participant

    @gperez-tl

    Hi.
    I’m trying to add content before the subscribe button. It would be a fake checkbox. But I’m not being actually able to use “before” option in bbp_topic_subscription_link function.

    Bug can be reproduced with something like this:

    bbp_topic_subscription_link(
    array(
    'subscribe'=>'Subscribe to thread notifications',
    'unsubscribe'=>'Unsubscribe from thread notifications',
    'before' => 'x'
    ) );

    That “x” will never appear. I can see it still in line 1055 of bbpress/includes/users/template.php, just before bbp_parse_args call. After that content dissapears:

    var_dump($args);
    // Parse arguments against default values
    $r = bbp_parse_args( $args, array(
    'subscribe' => __( 'Subscribe', 'bbpress' ),
    'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
    'user_id' => 0,
    'topic_id' => 0,
    'forum_id' => 0,
    'before' => ' | ',
    'after' => ''
    ), 'get_user_subscribe_link' );
    var_dump($r);

    Also, there’s another issue: ajax call will not keep my custom text. After you press the button text changes to defaults: subscribe \ unsubscribe. So, what’s the point of a custom text?

    Hope my request is clear.

    Thanks for all your work.

Viewing 2 replies - 1 through 2 (of 2 total)

  • gperez-tl
    Participant

    @gperez-tl

    Nevermind. Issue is caused by my theme. There’s a filter causing troubles:

    add_filter( ‘bbp_before_get_user_subscribe_link_parse_args’, ‘bbpress_remove_pipe_before’);

    So, “before” is working.

    Please give me some feedback about the second issue, the labels being overwritten after ajax call.

    Thanks.


    gperez-tl
    Participant

    @gperez-tl

    Almost solved:


    function lugpa_change_subscribe_button_texts($args){

    $fakeCbox = "<span class='subscribe-icon'></span>";
    $args = array_merge($args, array(
    'before' => '',
    'subscribe'=> $fakeCbox.' Subscribe to thread notifications',
    'unsubscribe'=> $fakeCbox.' Unsubscribe from thread notifications',
    ));
    return $args;
    }
    // in a future please check if all these hooks subscribes to a "topic"
    add_filter('bbp_before_get_forum_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
    add_filter('bbp_before_get_topic_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
    add_filter('bbp_before_get_user_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');

    However I’m not sure if all these hooks works over the same thing. Meaning, if they all are related to “thread subscriptions”.

    One more thing: I’d like to be able to distinguish if I’m in “replys” page or in “my subscriptions” page. Because If I’m in the second one I should keep the short version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar