Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • @fencer04

    Participant

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

    @fencer04

    Participant

    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

    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

    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

    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

    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

    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

    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

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

    @fencer04

    Participant

    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

    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

    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

    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