Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 2,756 total)

  • shanebp
    Moderator

    @shanebp

    $wpdb->get_col returns an array.
    Why are you setting the results to an array?
    $my_matches = array($wpdb->get_col ...

    >The problem is that $my_matches returns nothing. i.e. echo $my_matches[0] outputs Array.
    An array is being returned, that is different than returning ‘nothing’.
    Use var_dump( $my_matches ) to examine both the structure and the contents of the results.


    shanebp
    Moderator

    @shanebp

    Do you have a validation function in your class?
    Something like:

    public function is_valid( $values ) {
       $this->validation_whitelist = null;
       return parent::is_valid($values);
    }

    For a fairly simple example of adding a custom xprofile field, see BP xProfile Location
    ( yes, I know it does not yet reflect the recent changes to the Google API, but it should pass validation for your purposes )


    shanebp
    Moderator

    @shanebp

    $wpdb->get_col returns an array
    $wpdb->get_var returns a single value – try it

    https://codex.wordpress.org/Class_Reference/wpdb


    shanebp
    Moderator

    @shanebp

    When not using a BP profile loop, try using xprofile_get_field_data.


    shanebp
    Moderator

    @shanebp

    >I’m not sure what hooks are

    Look for that text in your theme’s member-loop template.

    >and I don’t know where bp-custom.php is.

    I provided a link to the documentation in my reply.


    shanebp
    Moderator

    @shanebp

    If that theme has not removed the bp_directory_members_item hook from the members-loop template, then you could use this function in bp-custom.php

    Assuming you have a profile field named ‘Title’ …

    function acie_show_member_data() {
    
    	$title =  bp_get_member_profile_data( 'field=Title' );
    
    	if ( $title != '' ) {
    		$str = $title . '<br>';
    		echo $str;
    	}
    	
    }
    add_action( 'bp_directory_members_item', 'acie_show_member_data' );

    shanebp
    Moderator

    @shanebp

    You could use the overload method.
    imo, using hooks is easier.

    For example, to hide admin users from the members loop, you could put this into bp-custom.php… untested…

    function grw_members_loop_ghosts( $retval ) {
    
        if ( bp_is_members_directory() ) {
    
            $admins = get_users( array(
    				'fields' => 'ID',
    				'role'   => 'administrator',
    			      ));
            
            $admins = implode(',', $admins );
    
            $retval['exclude'] = $admins;
        }
    
        return $retval;
    }
    add_filter( 'bp_before_has_members_parse_args', 'grw_members_loop_ghosts' );

    shanebp
    Moderator

    @shanebp

    The members loop template is here:
    buddypress\bp-templates\bp-legacy\buddypress\members\members-loop.php


    shanebp
    Moderator

    @shanebp

    >How to delete activities before a date

    BP Bulk Delete


    shanebp
    Moderator

    @shanebp

    The first and simplest step is to use one of the registration captcha plugins from the repo.

    https://wordpress.org/plugins/search/captcha/


    shanebp
    Moderator

    @shanebp


    shanebp
    Moderator

    @shanebp

    You can download it.
    Your problem is installing it.
    Your xampp installation is timing out.

    Look thru the xampp documentation for instructions on how to increase the php maximum execution time.


    shanebp
    Moderator

    @shanebp

    You cannot put php code into the Additional CSS area.

    You will not be able to integrate that plugin until you or somebody else can create / edit files on your site.


    shanebp
    Moderator

    @shanebp

    bp_displayed_user_id() only works on a profile page – the displayed user.

    Try using bp_loggedin_user_id()


    shanebp
    Moderator

    @shanebp

    For theme specific support, please contact the theme creators.

    And then post their response here.


    shanebp
    Moderator

    @shanebp

    I believe those warnings are related to fetching the plural form of a number.

    Do you have debug turned on in wp-config.php ?
    If the only issue is the Warnings, turning off debug should make them disappear.

    If they still appear or there are related issues, you should open a ticket at LearnDash.

    But first, to see if the issue is related to your theme, try switching momentarily to a WP theme like 2016 and see if the warnings persist.


    shanebp
    Moderator

    @shanebp

    You need to clarify your question.

    You want a link to go to ‘My Groups’ – does that mean the Groups page on their profile that shows all the Groups they belong to?

    Or a link that goes directly to a single Group ? Assuming they only belong to one group.

    Or… ?

    You may want to share your header code by using gist and then posting the link here.
    That way we can see the exact context.


    shanebp
    Moderator

    @shanebp

    Please follow the link I provided above. It explains everything you need to know.


    shanebp
    Moderator

    @shanebp

    You can prevent auto-links in the profile areas.

    You need to create a file called bp-custom.php and then add this function to it:

    function remove_xprofile_links() {
        remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
    }
    add_action( 'bp_init', 'remove_xprofile_links' );

    shanebp
    Moderator

    @shanebp

    These are the BuddyPress forums.
    The bbPress forums are on another site.


    shanebp
    Moderator

    @shanebp

    Create a template overload of this file: buddypress\bp-templates\bp-legacy\buddypress\members\members-loop.php

    And place your code wherever you want in the overload.

    bp_displayed_user_id() is incorrect in the context of the members loop.
    Instead:

    $user_meta = get_userdata(bp_get_member_user_id());
    echo($user_meta->description);

    Or instead of an overload, use this hook: do_action( 'bp_directory_members_item' );


    shanebp
    Moderator

    @shanebp

    Your theme is causing those issues. They also exist on the login page.
    To confirm, try switching momentarily to a WP theme like 2016 and see if the issues persist.

    You will need to contact the theme creator to get answers re your formatting issues.
    Or you will need to learn how to use css.


    shanebp
    Moderator

    @shanebp

    You could edit a template.
    If you are using profile cover images, edit buddypress\members\single\cover-image-header.php
    Otherwise, edit buddypress\members\single\member-header.php

    But you can use a function instead.
    Both the templates mentioned above have two action hooks:

    do_action( 'bp_member_header_actions' );
    do_action( 'bp_profile_header_meta' );

    Choose the one that will place your button where you want it and write a function that adds the button.


    shanebp
    Moderator

    @shanebp

    The hook you mention does not provide any arguments.
    Perhaps you need to research how do_action works.
    The hook I mentioned already provides the $user_id.

    Example:

    function sultry( $user_id, $user_login, $user_password, $user_email, $usermeta ) {
       // do something with $user_id
    }
    add_action( 'bp_core_signup_user', 'sultry', 10, 5 );

    shanebp
    Moderator

    @shanebp

    Please use the code button when sharing code.

    Nobody can help you if you don’t explain the errors.

    Please use gist when sharing large blocks of code.

    If you share your code and the errors, somebody might be able to help.

Viewing 25 replies - 1 through 25 (of 2,756 total)
Skip to toolbar