I just found the magnificent wp_insert_post function and have a few basic question about it. *For reference I used this on a multisite install for a number of blogs running theme_x. I simply wanted to add a page to each blog (without having to do it through WP Admin). This seems to have mostly-worked though I'm not sure I'm using it for its intended purpose?
- What happens if the specified page title already exists on several blogs? Does it a) terminate the function b)rename in typical WP fashion to "page-name-2" format, or c) something else?
- Should I remove the code from the theme template now that I have done what I needed to? I'd like to leave it in just incase more blogs are added which use this theme but I'm wondering if it creates unnecessary database overload (does it get run every page load)?
- The page doesn't appear anywhere in WP admin? Though all blogs using this theme do indeed resolve to the newly-added page like so ... URL/newly-added-page. This is fine for me in this instance, but it makes me think I'm not using the function "properly" (I kinda expected a new page in WP Admin also)