Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在进行一个项目,该项目将在激活插件时创建页面。但它是在现有的主要博客网站上创建的。它还希望在插件激活时自动在现有博客站点中创建。
$query = $wpdb->get_results("SELECT blog_id FROM $wpdb->blogs"); foreach($query as $result) { switch_to_blog($result->blog_id); wp_insert_post($my_post); }
请帮忙!
查看plugin activation hook
plugin activation hook
另外,请查看您的消息,目前还不清楚。