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 */
}
Related Posts:
- Perform action on WPMU blog deletion
- Make default new sites https (multisite)
- Which action hook to update custom field at network/site-info.php in multisite on update site info
- How to add Custom Blog Options to new blog setup form?
- How to remove action hook done in a plugin from functions.php in my theme?
- WP Multisite: Adding pages on blog creation by default
- Add new column to sites page
- Prevent Deletion of Blogs
- Hook filter to change wp_upload_dir() path in multisite
- Add site options UI in Multisite Sites > Infos page
- WPMU Hook for archive or deactivate blog?
- How to Remove a Filter from the Admin List Table?
- Remove action on product archive page [closed]
- Disable email field on WooCommerce customer account details
- How to prevent action in ajax request, when in admin side?
- Woocommerce – Hide a Column in Cart Table
- Add my own function to existing WooCommerce hook
- Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?
- What is the action hook for an order that fails on frontend checkout in WooCommerce?
- Woocommerce and different checkout field for different countries
- Hook up MU site creation
- Woocommerce Multisite Get Orders from Another Site
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- Edit WooCommerce product content based on category
- How to list all WC products by their attributes values?
- WooCommerce Multisite — importing products IN subsites FROM main site
- Execute JavaScript in WordPress Hook
- WooCommerce Hook: Content get’s displayed twice and not AFTER the order total
- Update blog option during create new blog?
- WooCommerce: after install hook
- password_reset doesnt work
- How to access deleted term inside delete_product_cat action
- Woocommerce – Adding row to cart table
- WordPress multisite with separate domains
- How to access page variable inside action hook
- Change Woocommerce languange on a multisite install
- Multi-vendor with custom shop site for each vendor
- Which Multi-language option for WordPress is best from an SEO and Woocommerce perspective?
- Display custom product option in admin order details
- Parameters in woocommerce_before_add_to_cart_button hook
- How do I remove an action hook inside a class that is called by another class?
- {status}_{post_type} does not run correctly?
- Multisite – each site with it’s own set of users
- What could cause wpmu_create_blog to throw “Already Installed” Error on multisite?
- WooCommerce API Returns 401
- Optimal setup for Multi Domain WordPress with Woocommerce
- Woocommerce Membership synchronised accross multisite
- Add external url to WooCommerce My Account navigation
- Allow users to register on multisite through WooCommerce using the same email address
- personal_options hook on WordPress multisite
- How to add custom checkout field in user details mail template
- add_action insert html
- Add text when displying attribute with a hook on single product page
- WooCommerce Webhook Action When a New Product Review was Submitted/Created
- Where are available Roles Defined in the wp_ database?
- WordPress Multisite: How to make all media library items available for every site?
- How to setup LDAP authentication with WP multisite
- Send data to 3rd party api with wp_remote_post on wp_login
- Is there an action for when permalinks are rebuilt?
- Send an email when custom post type category is changed
- latest 5 posts using switch_to_blog loop
- restore_current_blog() vs. multiple switch_to_blog() followed by removing $GLOBALS[‘_wp_switched_stack’]
- Two WordPress sites sharing the same database
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- WP Admin Bar frontend issue with dashicon deregister
- add_action for lost_password or modify wp-login.php?action=lostpassword
- Sub-subdomain getting redirected to main domain
- Multisite – create new site with precreated pages, menu etc
- How to work on a live WPMS blog when domain is unresolved? [closed]
- Fresh Multisite Install – Can’t Log In
- Should action callbacks start with a verb?
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- How can i redirect my Blog to a Subdomain?
- WordPress Multisite Redirection Issue
- Multisite user roles – capabilities not working
- Remove an action by extending class and replacing it
- Error : Cookies are blocked or not supported by your browser
- How To Run Multiple Multi-Site Networks On Same Box [closed]
- Changed sub-site to its own domain trigger 302 redirects for all page links
- How to remove products-links after the product title using remove_action
- Which is the correct way to migrate content from single WP to WP multisite
- How to have one installation at blog.example.com and multiple blogs in sub folders such as blog.example.com/userA?
- Is there a author_update action?
- Running hundreds of WP in multisite
- Bitnami multisite change URL of secondary blog
- Hook to change the site URL
- Domain not redirected correctly with WordPress Multisite
- Can assign a new domain to a site in a multisite?
- Hook into all password resets in WordPress and get password before hashing?
- Possible to have duplicate usernames on different two multisites
- Main site media are accessible in subsite domain
- WordPress Reset password Strength set to medium
- Including non-wordpress pages within a single multisite domain
- How can I import posts into different wordpress multisites at once?
- How to login a user with wp_set_auth_cookie on a specific blog within a multisite environment
- How to handle responsive and non responsive websites in one WordPress Theme?
- Swap domains of two sites with each other in multisite
- Many big issues in the website, WP_Debug not showing
- different image for mobile template block theme
- How can I get all attachments by a user on a WP multisite network?