BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 886

    code is ok sir

    Thanks

  • Participant
    Level: Guru
    Posts: 886

    Kind reminder sir

  • Participant
    Level: Guru
    Posts: 886

    YES YES YES! It worked perfectly Brajesh

    Thanks so much Brajesh ive been looking for a solution to anononymous content for a long time now.

  • Participant
    Level: Guru
    Posts: 886
    Tosin on in reply to: [Resolved] Clear cookies on logout #45253

    I am only looking at security and privacy benefits, because if there are vulnerabilities in WordPress or in your browser, or if someone has access to your computer or device, they may be able to access these cookies.

    Likewise, when a user logs out of your site using a public or shared computer, there won’t be any domain cookies left behind.

    The code gives you back the “regular user view” of your site, because after you log out you can browse your site as an anonymous user, without having to manually clear cookies in your browser. (There are some plugins that will display different content or show cached or uncached versions of pages if they see that WordPress cookies have been set.)

  • Participant
    Level: Guru
    Posts: 886

    Any update sir

    thanks

  • Participant
    Level: Guru
    Posts: 886
    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: 886
    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: 886
    Tosin on in reply to: buddyblog medium editor not displaying embeds #45210

    Maybe there is a conflict with gutenberg

  • Participant
    Level: Guru
    Posts: 886

    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: 886

    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.