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
- How to modify username before logging in?
- WooCommerce Webhook Action When a New Product Review was Submitted/Created
- Is it necessary to network enable both the parent and child theme for multisite installations?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How to run a function after wp() in the wp-blog-header.php file?
- WooCommerce checkout page price break down table hook
- Migrating wordpress sites through localhost and ubuntu
- Display attribute on shop page after the title
- Wait ajax to complete before continue loop
- Remove actions/filters that are set with create_function()
- Hook for inserting?
- How to use the sunrise.php script for Multisite network domain mapping?
- WP/WooCommerce multisite with polylang, product duplication between websites [closed]
- Move existing WordPress install to Multisite
- How to output woocommerce products to a page, style and modify the html structure
- Filter default_content only for products
- Multisite on single wordpress
- WordPress multisite not work wp-admin
- Delete user from multisite when removed from subsite
- how to control display switch_to_blog( $subsite->blog_id ); $tags = wp_tag_cloud
- Page Builders and WP Multisite
- Notify admin when Custom post meta data gets updated or deletet
- Why are “numeric only” names disallowed when creating a new site in a WordPress multisite network?
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- Create website with a switch between private and business [closed]
- How do I get the Payzone WooCommerce payment gateway plugin to show up in the settings? [closed]
- How to remove a class function from a plugin by using remove_action()?
- Filter WooCommerce archive pages by an additional category
- How to organize my js files
- Installing multisite network on a bluehost addon domain
- Automatically set post_parent value
- dynamic add_action according to child pages (for homepage control)
- Conditional action hook
- Can’t log in to wp-admin after setting up Multisite
- Remove action in a parent theme from the child theme
- Remove action within a class in a parent theme’s includes folder from the child theme
- What is the best method of installing WP on multiple add-on domains?
- Should i install multiple wordpress for one site?
- Multisite 404 for pages in includes subdirectory
- If statement in wp-config.php, is it possible?
- WP MultiSite: Can’t select database error after changing to new domain
- Advanced WordPress plugin activation detection
- How do I correctly configure my AMPPS localhost to use subdomains for multisite?
- Is this possible? A multisite with “www.example.com/en/blog/” and “www.example.com/cn/blog/” (two directories deep)
- Is it possible to disable html code error auto fixing feature by wordpress 4.9.1?
- Combining user database tables while keeping all other data in seperate for multiple sites?
- switch_to_blog() not functioning while querying post_types, Why?