Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help with bbPress Topics for Posts addon plugin

  • @droidafrica

    Participant

    Hi…
    I’m trying to combine bbPress and bbPress Topics for Posts addon in a certain way. But I needed to extend the bbPress Topics for Posts, a dev. work which was successful.

    But in the process of extending the addon plugin, the “Apply settings to existing posts” section in the addon setting was touched, which created unwanted forums that needed to be deleted. So I reset the forum completely.

    But now, I’m hitting on “Apply settings to existing posts”, but it is not working with old post?. Please, what can I do to get old post to sync again?

Viewing 6 replies - 1 through 6 (of 6 total)
  • @droidafrica

    Participant

    Can I get any help on this forum at all?

    @webcreations907

    Participant

    Hi,

    Did you try asking the developer of that plugin?
    You can post on their support page here:https://wordpress.org/support/plugin/bbpress-post-topics/, other users of that plugin might be able to help if you post on there.

    @droidafrica

    Participant

    Thanks for getting back. I’ll do as you have suggested. Just that the dev. has abandoned the plugin for years now.

    @webcreations907

    Participant

    They may have quit working on it.

    I did some digging through their code, and came up with something for you to try if you want.

    You’ll add the below code to your theme’s functions.php file, once you add the code and save the file. Reload your WordPress admin area by refreshing the page/browser, then remove the code and re-save the file.

    Go to your discussions page, and try out that button(Apply settings to existing posts) again and see if it works for you.

    
    
    if(!function_exists('bbppt_reset_topics_for_posts_meta_fix')){
    	function bbppt_reset_topics_for_posts_meta_fix(){
    		$args = array(
    		    'meta_key' => 'bbpress_discussion_comments_copied',
    		    'post_type' => 'post',
    		    'post_status' => 'any',
    		    'posts_per_page' => -1
    		);
    		$posts = get_posts($args);
    		if($posts){
    			foreach ($posts as $post) {
    				delete_post_meta( $post->ID, 'bbpress_discussion_topic_id');
    			    delete_post_meta( $post->ID, 'bbpress_discussion_comments_copied');
    
    			    $comments = get_comments( array( 'post_id' => $post->ID, 'order' => 'ASC' ) );
    			    if($comments){
    			    	foreach ($comments as $comment) {
    			    		delete_comment_meta( $comment->comment_ID, 'bbppt_imported');
    			    	}
    			    }
    			    
    			}
    		}
    	}
    	add_action( 'admin_init', 'bbppt_reset_topics_for_posts_meta_fix' );
    }
    
    

    @droidafrica

    Participant

    ….

    @droidafrica

    Participant

    Wow…Thanks for these code.
    I tested it on my test site with newmag wordpress theme by tagdiv and it worked.
    But on the main site, I’m using Jnews Child theme. I tried it, but it did not work. Perhaps it because I don’t know which function.php to use; main theme or child theme funtion. Tried with child theme, but it did not work.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar