BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 913
    Tosin on in reply to: Buddypress biometric login #45221

    Just did some digging around and found this two

    1. https://wordpress.org/plugins/wp-webauthn/
    2. https://wordpress.org/plugins/passwordless-wp/

    Integrating this with buddypress and branded login plugin also sounds interesting.

  • Participant
    Level: Guru
    Posts: 913
    Tosin on in reply to: buddyblog medium editor not displaying embeds #45219

    yes im using gutenberg and yes the video is appearing when embeded in the post creation page.

    But after post submission the embed no longer appears in the blog post

    Also after clicking the edit post link which redirects back to the post creation page I no longer see the video embed just the video url in plain text.

  • Participant
    Level: Guru
    Posts: 913
    Tosin on in reply to: buddyblog medium editor not displaying embeds #45210

    Maybe there is a conflict with gutenberg

  • Participant
    Level: Guru
    Posts: 913

    YES im sure the anonymous user ID exists.

    1. workflow setting = on submission – publish post
    2. I also have a custom post taxonomy called (locations)
    3. redirect user to = Yes, to the single post screen.
    4. im also using the shortcode [bbl-create-by-post-type post_type=’post’] in the (create-new-post) page
    5. I also have buddyblog pay per post active

    This is all the buddyblog code I have I dont think there should be any conflict

    
     // Request confirmation before post submission.
    add_filter( 'bblpro_submission_button_classes', function ( $classes ) {
    	array_push( $classes, 'bbl-confirm-action' );
    
    	return $classes;
    } );
    
    // Buddyblog minimum words for publishing
    add_filter( 'bblpro_validation_errors', function ( $errors, $data ) {
    
    	if ( $errors->has_errors() ) {
    		return $errors;
    	}
    	$content     = empty( $data['bbl_post_content'] ) ? '' : $data['bbl_post_content'];
    	$words_count = (int) str_word_count( $content );
    
    	if ( $words_count < 100 ) {
    		$errors->add( 'bbl_post_content', _x( 'A minimum of 100 words is required to publish.', 'Post form validation message', 'buddyblog-pro' ) );
    	}
    	return $errors;
    }, 10, 2 );
    
    /**
     * Assign (Sponsored Post) category to BuddyBlog pay per post articles on checkout.
     */
    add_action( 'bblpro_ppp_post_published', function( $post_id ) {
    	$post_type = get_post_type( $post_id );
    	if ( 'post' != $post_type ) {
    		return;
    	}
    	// Get category.
    	$newcat = get_term_by( 'name', 'Sponsored posts', 'category' );
    	if ( ! $newcat ) {
    		return;
    	}
    	wp_set_post_categories( $post_id, $newcat->term_id, true );
    } );
    
    /**
     * Update BuddyBlog Author when a post is submitted in a specific category.
     */
    add_filter( 'bblpro_post_submission_prepared_data', function ( $post_data, $form_id, $post, $is_submission ) {
    	// update author if the category was selected. Don't do anything on edit.
    
        $anonymous_cat_id = 1487;
        $anonymous_user_id = 4766806;
    
        if( ! $is_submission ) {
            return $post_data;
        }
    
    	$selected_terms_ids = isset( $post_data['tax_input'] ) ? (array) $post_data['tax_input'] : array();
    
    	$selected_categories = isset( $selected_terms_ids['category'] ) ? (array) $selected_terms_ids['category']: array();
    
        if( ! $selected_categories  || ! in_array( $anonymous_cat_id, $selected_categories ) ) {
            return $post_data;
        }
    
    	// Update.
    	$post_data['post_author'] = $anonymous_user_id;
    	// keep current user data for future?
    	if ( ! empty( $post_data['ID'] ) ) {
    		update_post_meta( $post_data['ID'], '_bbl_original_post_author', get_current_user_id() );
    	}
    
    	return $post_data;
    }, 10, 4 );
    
  • Participant
    Level: Guru
    Posts: 913

    I just tested the code but it did not work, the current logged in user is still the post author instead of the assigned anonymous user.

  • Participant
    Level: Guru
    Posts: 913

    will be expecting your feed back sir.

    thanks

  • Participant
    Level: Guru
    Posts: 913

    1. No I dont want to limit the scope, this update should be applicable to all forms

    2. Yes i’m referring to post category (category id = 1487) while use ID that will inherit the submitted post = 4766806

    Thanks

  • Participant
    Level: Guru
    Posts: 913

    Kind reminder sir

    Thanks

  • Participant
    Level: Guru
    Posts: 913

    I want new users to be friends with all the featured members.

  • Participant
    Level: Guru
    Posts: 913

    I already tested the code but it did not work