BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25058
    Brajesh Singh on in reply to: Variable Outside Function #1819

    Hi,
    1. Globals are not going to be deprecated in PHP 7 and there is little/no chance that it will ever happen.

    2. Since the code is not complete, I can not guess how you are taking the details from the user.

    I am sorry but I am not available for hire at the moment due to my commitments with BuddyDev work. But, Your task seems easy enough to me and you do not need to hire me to get it completed.

    Please send me the code on brajesh@buddydev.com and I will send you the updated one. This seems to be small functionality that should not take much time.

  • Keymaster
    (BuddyDev Team)
    Posts: 25058
    Brajesh Singh on in reply to: [Resolved] How to Create a Custom Page for Groups? #1815

    Hi Chelle,
    I am sorry I could not post earlier. Will be posting the plugin tomorrow Indian time.

    Thank you for your patience.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25058

    Thank you Richard.
    It will be helpful for not only MediaPress but other plugins too that adds nested pages on user pages.
    Thank you for posting it here, It will certainly help others too.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25058

    Thank you Hans and Ernesto.
    Glad it is fixed 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25058
    Brajesh Singh on in reply to: Variable Outside Function #1810

    Hi,
    Have you tried this

    
    
    function my_custom_subnav() {
    	global $bp;
            global $collection_term;
    	$collection_term_slug = preg_replace('/\s+/', '-', $collection_term); // replace spaces with hyphens.
    	  $collection_term_slug = preg_replace('/[^A-Za-z0-9\-]/', '', $collection_term); // Removes special chars.
    	$screen_function_name = 'subnav_function_to_show_' . $collection_term_slug;
    	
    
    	bp_core_new_subnav_item( array( 
    		'name' => $collection_term,  
    		'slug' => $collection_term_slug,  
    /* rest of the code */
    
    

    and make sure that you initialize $collection_term before making a call to

    
    
    my_custom_subnav()
    
    

    That should work. Can you please give it a try. If you are initializing $collection_term in another function, then declare it global there too. Also, It must be initialized before call to the function.

  • Keymaster
    (BuddyDev Team)
    Posts: 25058

    Hi Pellet,
    My apologies for the inconvenience. Which strings are you trying to translate?

  • Keymaster
    (BuddyDev Team)
    Posts: 25058

    Thank you Richard.
    You are right about the cause. I am glad you found it. BuddyPress dynamically replaces actual content with the generated content( and in this case WordPress was regenerating excerpt based on that generated content). the_content() is the right function.

    use bp_is_user() for conditional testing since it will fix problem with other plugins too.

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 25058

    Hi Richard,
    Thank you for the update.

    Yes, if it is still happening with the parent theme then your child themes functions.php is not causing it.

    That is a premium theme, so I can not do much for now. Please do take your rest and when you are back, Let us check it on your server and I will troubleshoot it there.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25058

    This code is fine.
    As far as I checked on the site, activating other themes make this work but when I reactivated your theme, the page went away.

    So, It is confirmed that it is some modification in the theme causing this.

    Can you please think of any such modifications in your functions.php? or can you please activate the parent theme and see if that works?

  • Keymaster
    (BuddyDev Team)
    Posts: 25058

    Thank you. Please do send the details. If the Username plugin is working that means your plugins.php is working fine. it is something else then.

    Looking forward to the details.

    Thank you
    Brajesh