get_current_site()
is a (globally accessible) function (located in ms-functions.php
), it’s not a class method, so simply call it it by its name like you would do with any other function.
$currentSite = get_current_site();
Related Posts:
- Disable plugin / plugin action via theme
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- Need to create a Theme demo site that features multiple themes
- Define Function in functions.php or plugin and call in theme loop
- Autogenerate wordpress shortcodes using array?
- Why does including a file in theme’s functions.php not work?
- WooCommerce create new product and add to cart on form submit
- Adding New Role
- Shortcode under a Shortcode Multiple times Possible?
- Add Top-Level Menu that opens URL
- wordpress custom login successful redirect hook
- WordPress ajax call for not logged in users, doesn’t work
- Display All Non-Used Plugins
- Override plugin functions in functions.php
- New Plugin: Post update pushes a copy as a revision
- Placement of Code in Plugin for hooking `save_post`
- Display a text message if the field is not found and not if found
- Add get_option to jquery
- Add a plugin before main container
- Get all categories of custom post even not assigned
- Function to prevent users from trashing comments
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- How to add class in plugin only for network site?
- How does WordPress process plugin installations?
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- PHP Fatal error: Call to undefined function plugin_basename
- Executing my function once on a specific time
- Missing Argument
- load_plugin_textdomain error
- wordpress plugin is not activating from widget
- Adding Shortcode to Text Widget
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Using a function to change favorites listing
- How to use a class from another plugin
- WP Query. Is there a maximum size?
- How to remove custom post type and add category and post name
- bbPress plugin: forum lists not showing in correct order? [closed]
- Difference and examples of esc_attr__() and esc_attr_e()
- Is there a best practice remediation for PhpStorm’s warning that void function the_post_thumbnail is used?
- How to prevent additional code in functions.php to be removed once there is an update?
- Proper way to use plugin functions in functions.php
- How to reset the plugins without deactivate the plugin
- plugins_url() works everywhere but wp_reqister_script()
- Replacing global wp_query
- WordPress Stock Update Programatically
- 5 PHP Fatal error: Uncaught ArgumentCountError (Cannot Find)
- Woocommerce singe product custom gallery output works just on the first slide
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- How to translate wordpress error message
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- same user role or copy the user role to be same as the other role
- How can i listing current category and Featured Category post list?
- More gentle way to hook WordPress custom url
- Removing the custom_image_header from wp_head
- auto activate plugin when theme is active
- Build a must-use plugin that tracks when other plugins are activated or deactivated
- Checkbox show / hide output result
- How to keep plugin (media-sync) running even the tab is closed?
- Load CSS before Theme CSS
- Custom Logo Link WordPress
- Where do I put the code snippets I found here or somewhere else on the web?
- How to convert Currency from USD to other IP Based currency in Php function
- How would I get the new plugin version on this function?
- Attempting to list all product categories and the price range of all products within them
- the_posts_pagination() not working if I add wp_head() to header.php
- FPDF for creating pdf diplomas
- Creating an array from form inputs before it is posted to the options database
- function post to trash problem
- adding dynamic/multiple slug values in ‘option_none_value’
- How to assign a specific service to a specific provider based on location
- Conditional Homepage for logged in user
- Modify function output in a plugin
- Is admin section completely customizable in terms of styling?
- Compare Ajax Data Results
- EventON – Dequeue Styles
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- Migrating custom php we wrote from functions.php into a site-specific plugin
- Nested DIV’s across functions in PHP, do not seem to work
- WordPress Add advertising ads befor and after content with periority [closed]
- Function in my plugin is called twice
- Searched & tried a lot: Is it Possible to Eliminate Render Blocking Manually
- Every time I use wp_get_current_user() my plugin breaks
- Can plugin automatically update if i hide the update notification?
- Conditional required fields for WordPress Contact Form 7
- AJAX login without a plugin does not work. when add a action to function.php
- WordPress function to add text
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- How to use scripts when header/footer are stripped out
- How to add a handler for a button in plugin?
- Custom Function for SEO by Yoast plugin
- Call current post parameters inside a plugin
- How to list posts that appear in two categories
- add query string to all pages after user logged in
- Simple WordPress function / plugin to redirect a site
- Sync roles across several plugins
- Requires PHP version 5.3.0
- Make plugin admin page visible to other roles
- Show WooCommerce products based on query parameters on redirect
- wp_enqueue_script doesn’t load JS in plugin