Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create similar topics to several forums at once


  • mstas1234
    Participant

    @mstas1234

    I have the following situation:

    Several forums (i.e. five or six) and I would like to create three topics per each forum,

    but the topics are completely the same.

    So the question is if it is possible to create the topics at once for all the avalaible forums?

    (I know that I can import topics from CSV file, for instance, using my forums` IDs,
    but I wonder if there another solution)

    Thank yo very much in advance!
    You will save my life!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Not without coding… But if it’s only for 5 or 6 forums, a copy/paste will go a lot faster.


    mstas1234
    Participant

    @mstas1234

    Thanks a lot for your response!

    Do you have an idea about that code?

    And another question (maybe you know). Is it possible to obtain all the IDs of created forums to a separate file?

    If you would go with bbp_insert_topic, just change the post_parent on every insert.

    And to get the IDs, you will have to create a loop with ‘while (bbp_forums())’


    mstas1234
    Participant

    @mstas1234

    Thank you so much for your help!
    Actually, I`m a bit “rusty” in this.

    Are you able to help me with this?
    I mean if it is possible to provide me the code and the location where I need to insert it.

    Thanks in advance!


    mstas1234
    Participant

    @mstas1234

    Sorry for disturbing, but I really need to extract all the IDs of forums I have.

    Tha fact is that I have a huge amount of them and it is very and very difficult to open each forum and copy ID.

    So it will be amazing to extract the IDs, let`s say, to a separate document or something like that…

    Is it possible?

    Add this in your functions.php or in a plugin:

    add_filter( 'manage_edit-forum_columns', 'casiepa_edit_forum_column' ) ;
    function casiepa_edit_forum_column( $columns ) {
    	$columns['id'] = __('ID');
    	return $columns;
    }
    
    add_action('manage_forum_posts_custom_column', 'casiepa_manage_forum_columns', 10, 2);
    function casiepa_manage_forum_columns($column_name, $id) {
        global $wpdb;
        switch ($column_name) {
        case 'id':
            echo $id;
                break;
        default:
            break;
        } // end switch
    }   
    

    It will add the ID column when you go in your Dashboard to ‘Forums’.
    Pascal.


    mstas1234
    Participant

    @mstas1234

    Amazing!
    Thank you very very much!You saved my life!
    It works great!

    You’re welcome, glad it helped.
    Pascal.

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