add_attachment.php
1 month ago
admin_head.php
1 month ago
admin_init.php
1 month ago
admin_menu.php
1 month ago
admin_notices.php
1 month ago
attachment_updated.php
1 month ago
delete_post.php
1 month ago
pmxi_after_xml_import.php
1 month ago
pmxi_before_xml_import.php
1 month ago
pmxi_extend_options_custom_fields.php
1 month ago
wp_ajax_auto_detect_cf.php
1 month ago
wp_ajax_auto_detect_sf.php
1 month ago
wp_ajax_delete_import.php
1 month ago
wp_ajax_dismiss_notifications.php
1 month ago
wp_ajax_import_failed.php
1 month ago
wp_ajax_test_images.php
1 month ago
wp_ajax_wpai_dismiss_review_modal.php
1 month ago
wp_ajax_wpai_send_feedback.php
1 month ago
wpmu_new_blog.php
1 month ago
wpmu_new_blog.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 4 | function pmxi_wpmu_new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) |
| 5 | { |
| 6 | // create/update required database tables |
| 7 | require_once ABSPATH . 'wp-admin/includes/upgrade.php'; |
| 8 | require PMXI_Plugin::ROOT_DIR . '/schema.php'; |
| 9 | global $wpdb; |
| 10 | |
| 11 | if (function_exists('is_multisite') && is_multisite()) { |
| 12 | // check if it is a network activation - if so, run the activation function for each blog id |
| 13 | $old_blog = $wpdb->blogid; |
| 14 | |
| 15 | switch_to_blog($blog_id); |
| 16 | require PMXI_Plugin::ROOT_DIR . '/schema.php'; |
| 17 | dbDelta($plugin_queries); |
| 18 | |
| 19 | // sync data between plugin tables and wordpress (mostly for the case when plugin is reactivated) |
| 20 | |
| 21 | $post = new PMXI_Post_Record(); |
| 22 | $wpdb->query('DELETE FROM ' . $post->getTable() . ' WHERE post_id NOT IN (SELECT ID FROM ' . $wpdb->posts . ')'); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,PluginCheck.Security.DirectDB.UnescapedDBParameter |
| 23 | |
| 24 | switch_to_blog($old_blog); |
| 25 | return; |
| 26 | } |
| 27 | } |