WordPress Multisite: Adding actions to only one site

Use get_current_blog_id() to check the current site. To run on site 2 only, use this:

function new_meta_values($order_id) {
    if ( 2 !== get_current_blog_id() )
        return;

    /* the rest of the function code */
}

Leave a Comment