Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Fencer04
    Participant

    @fencer04

    Thank you @danbp this was really helpful and set me on the right path.


    Fencer04
    Participant

    @fencer04

    I’m confused by your response. How can I check if a thread ID exists when the function I’m using isn’t getting called because I don’t have the proper action hook?


    Fencer04
    Participant

    @fencer04

    That did the trick. Thank you, I have thought about that a ton of times but never tried it. I really appreciate the help.

    Is there anyway to be able to put that function in the other file? It would be nice to keep it with the others.


    Fencer04
    Participant

    @fencer04

    So I moved my function into the functions.php file in my theme and now it is working with AJAX. It is something about being in my plugin that is causing it run only when the page is initially loaded. Any ideas?


    Fencer04
    Participant

    @fencer04

    Still nothing, I’m using XDebug to see if the function is being called. On the first page load the function gets called. After that I catch the core bp_ajax_querystring is getting called but not my function. It is really frustrating. If anyone knows of a plugin that uses it that I could review that would be helpful also.


    Fencer04
    Participant

    @fencer04

    No matter which option, filter or action, I use the code isn’t called when the AJAX search is run. Is there a particular time when I need to add the action or filter? Does it matter that I’m doing this through a plugin?


    Fencer04
    Participant

    @fencer04

    shanebp – I have another function that is using the bp_pre_user_query_construct hook. It is not run when AJAX search is run. In my research this is normal and bp_ajax_querystring is the way to go for these cases.

    Henry Wright – Here is the code and hook exactly how it is in my plugin file:

    function sbpp04_hide_from_ajax_search( $query_string, $object ){
    	if( !empty( $query_string ) ){
    		$query_string .= "&";
    	}
    
    	$query_string .= "exclude=2";
    
    	return apply_filters( 'sbpp04_hide_from_ajax_search', $query_string, $object );
    }
    add_filter( 'bp_ajax_querystring', 'sbpp04_hide_from_ajax_search', 50, 2 );

    Fencer04
    Participant

    @fencer04

    I have a plugin that allows user to block themselves from the member page. It is currently working with regular search but not for the AJAX search.


    Fencer04
    Participant

    @fencer04

    I’ve tried a ton of numbers all the way up to 999. Nothing works.


    Fencer04
    Participant

    @fencer04

    I was thinking the same thing about the redirect. You may not understand why you are being redirected there. I’m planning on setting up a different message for that similar to the Friend’s Only message. Iw will also have an option to redirect since that was actually a request I got from a client.

    The whole idea is that the profile is locked down completely so I don’t want the viewer to see the activity or any other part unless they fit the criteria laid out by the member.

    Thank you again, if you are interested in testing out future versions let me know and I’ll contact you when I post them.


    Fencer04
    Participant

    @fencer04

    Thank you for the clarification. The “Private” tab should not appear unless you are being blocked. I posted an update that resolves that issue as well as some related to the Friends Component not being activated.

    Can you install that and let me know if you still see Private all the time?


    Fencer04
    Participant

    @fencer04

    Turns out the error you pointed out is a bug that is being tracked in BuddyPress. It will be resolved in version 2.7. I will still see if I can alleviate it somehow:

    https://buddypress.trac.wordpress.org/ticket/7203


    Fencer04
    Participant

    @fencer04

    I really appreciate the review. I’ll look into the error on a fresh install and see what happens. I have a question about the “Private” button.

    This should only appear if the person has selected Friends only. Is it appearing all the time for you?

    Can you explain this comment further:

    – the original BP Add as friend button on profile header or members directory is still there. This means that there is no need to go on Private tab to ask forfriendship.
    This is a little confusing !

    I’m not sure what you mean by this. Why is having the button in two places no good?

    I agree with the location of the settings. That is on my list of changes to make shortly.

Viewing 13 replies - 1 through 13 (of 13 total)
Skip to toolbar