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
- Passing a parameter to filter and action functions
- Add action hook conditionally – only when home.php in use
- How would I compare and remove hacks to core?
- Multisite Login Issues
- Shared upload folder in wordpress multisite
- WordPress multisite with different domain
- Clone a wordpress website with same functionality, but different content
- Find variables available at a given hook
- Stuck with WordPress Multisite Custom signup page without .htaccess modification
- wp-admin redirect loop with ssl
- wordpress multisite, https for whole site or just admin?
- Multisite network admin – URL / redirect error
- Removing “Sub-menus” from My Sites Drop-down in Admin Bar
- wp_signon( $creds, false ); not working
- MultiSite Move conjures duplicate URL
- How to query WP Multisite primary site link
- Create batch of sites WordPress MultiSite
- Call to undefined function wp_get_sites()
- Capture post content before page renders
- In multisite environment which is the most Popular blog?
- Share reusable blocks between network sites
- WordPress rewrite multisite blog url
- How to transfer existing WordPress website to new multisite wordpress domain?
- Can Multisite run without domain name in WordPress?
- Copying media from multisite subsites to main website
- WordPress Multisite blogs not working after domain swap
- WordPress Multisite – Load users using custom query
- Is it possible to load wp-content/uploads from another server?
- Domain Mapping subsites of an Add-on Mulsite Domain
- Multi-Site / Single Site Decisions
- Multi-site site nav, wpdb->prepare missing argument
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- RTrouble passing arguments to action
- query multisite blog for post by tag
- WordPress Multisite on multiple sub-domains
- Count singular post views automatically
- How to add WordPress site to multisite network when both are addon domains
- How can I insert custom html code inside a div dynamically?
- Get posts by user role in a Multisite
- WPLANG option not available in localhost
- how to make a cronjob run, when user needs to be logged in
- Create woocommerce order on new user registration
- All Subsites of a WordPress Multisite install 302 redirects to the main site
- How to find the site ID on a single site and then add new post with “`multipart/form-data” enctype?
- WordPress Domain Mapping shows new domain in place but takes me to the sub domain
- Send data using GET method not work correctly
- Multisite subdomain microsite on secondary domain