• Resolved french5000

    (@french5000)


    Hi,

    My future website combine social components (buddypress/bbpress), e-commerce (via woocommerce), and multilingual.

    Woocommerce multilingual require Wpml-media. And wpml-media… makes avatar suggestions not working anymore (unable to upload on admin any avatar suggestion).

    Is there any chance to get this working ? Or is there any alternative to this plugin ?

    Thank you,

    Fran?ois

    https://www.ads-software.com/plugins/bp-avatar-suggestions/

Viewing 2 replies - 1 through 2 (of 2 total)
  • You mean as soon as Wpml-media is activated, it makes BP Avatar Suggestions plugin fail ? In other words, if you deactivate Wpm-media, avatar suggestions are working ?

    Thread Starter french5000

    (@french5000)

    Yes, exactly.

    I’v solved my problem by “forking” the plugin and do some dirty hacks in bp-avatar-suggestions.php :

    – In setup_globals, i replace
    $this->avatar_post_id = bp_get_option( 'bp_avatar_suggestions_post_id', 0 );
    with this :
    $this->avatar_post_id = icl_object_id(bp_get_option( 'bp_avatar_suggestions_post_id', 0 ), 'post', false,ICL_LANGUAGE_CODE);

    – In is_avatar_suggestion (very dirty solution, my website has only 2 languages) :

    // Update to the 'All type'
    		if ( empty( $has_meta ) ) {
    
    			$second_lang = ICL_LANGUAGE_CODE == 'fr' ? 'en' : 'fr';
    			update_post_meta( $attachment_id, '_bpas_avatar_type', 1 );
    			update_post_meta( icl_object_id($attachment_id,'attachment',true, $second_lang), '_bpas_avatar_type', 1 );
    
    		}

    I’ve also replaced the add_action( ‘bp_loaded’ … by add_action( ‘bp_init’, …

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatibility with wpml-media’ is closed to new replies.