The MU forums have moved to WordPress.org

Query to WPMU (3 posts)

  1. RCB I.T. Solutions
    Member
    Posted 15 years ago #

    Alright, so my project is underway and the first order of business is to do some customizing of new blogs, from some reading of mine I can write a function to make my customizations and use add_action() to run the function after the blog creation process.

    So I got the follow 8 queries I'd like to run once a new blog is made and I am wondering how I could do it using the connection WPMU establishes.

    DELETE FROM wp_1_comments WHERE wp_1_comments.comment_ID = 1 LIMIT 1

    ALTER TABLE wp_1_comments AUTO_INCREMENT = 1

    UPDATE rcbit_collabnet.wp_1_links SET link_url = 'http://rcbitsolutions.com', link_name = 'RCB I.T. Solutions Website', link_rss = '' WHERE wp_1_links.link_id = 1 LIMIT 1

    DELETE FROM wp_1_links WHERE wp_1_links.link_id = 2 LIMIT 1

    ALTER TABLE wp_1_links AUTO_INCREMENT = 2

    DELETE FROM wp_1_posts WHERE wp_1_posts.ID = 2 LIMIT 1

    ALTER TABLE wp_1_posts AUTO_INCREMENT = 2

    UPDATE rcbit_collabnet.wp_1_terms SET name = 'External Links', slug = 'external-links' WHERE wp_1_terms.term_id = 2 LIMIT 1

    Also I don't see a blog created action to hook into on http://codex.wordpress.org/Plugin_API/Action_Reference#Further_Reading or does that list WP specific and not MU hooks.

  2. RCB I.T. Solutions
    Member
    Posted 15 years ago #

    Also how would I get the blog id of the blog that was just created to pass into my function to make the changes to the right tables?

  3. RCB I.T. Solutions
    Member
    Posted 15 years ago #

    I just downloaded plugincommander, and looked at it's code to activate plugins for new blogs and derived some code from that.

    EDIT: My code however had some issues, someone on the WPMU irc chat recommended http://wpmudevorg.wordpress.com/project/WPMU-new-blog-settings-plugin so I will try that.

About this Topic

  • Started 15 years ago by RCB I.T. Solutions
  • Latest reply from RCB I.T. Solutions