Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9281573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:09:16+00:00 2026-06-18T18:09:16+00:00

I am developing my first wordpress plugin, and i need to get the site

  • 0

I am developing my first wordpress plugin, and i need to get the site name.

The documentation says to use get_current_site_name( $current_site ) function.

Here is my script

myPlugin.php:

$site_data = get_current_site_name( $current_site );

but get_current_site_name() function is not defined yet.

Also there is no global $current_site variable, as written in documentation.

I also try to add a wp_loaded action, to let the wordpress load fully, but it doesn’t help.

function myfunction() {
     global $current_site;
     $site_data = get_current_site_name( $current_site );
}
add_action('wp_loaded', 'myfunction');

//Fatal error:  Call to undefined function get_current_site_name() in ...

What I’m doing wrong?

Thanks

Update:

There is a bug in this site, when i try to write hello at the top of my question, it strips it automatically. So i’m writing it here – Hello guys 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T18:09:17+00:00Added an answer on June 18, 2026 at 6:09 pm

    That function is only available in network mode. It will return the name of the site (the one you use when you create the site), not the title that you set in the options.

    You probably want to use get_bloginfo('name'). This one returns the site title. Yeah I know, inconsistent naming, global variables …it’s WP 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing my first ever MODx site and I need to have three blocks
I'm developing my first Wordpress plugin, and I have one line which deletes an
This is my first WordPress 3 site. I'm currently developing a site for a
I installed the jScrollPane plugin on a WordPress site I am developing. It works
I am developing a Wordpress plugin to run a certain javascript function based on
Hi Stack Overflow community. I'm developing a wordpress website for Satan. First of all,
I'm developing a WordPress 3.0 theme, my first theme with a bit of jQuery
I am developing my first large Ubercart site, which needs to have a daily
I am developing my first rails site (yup, i am a rails idiot). I'm
I am currently developing my first Android application by reading Dev Documentation at Android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.