We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Site ID Global Variable

Development and Programming

Wes Rice's avatar
Wes Rice
103 posts
16 years ago
Wes Rice's avatar Wes Rice

Moderator’s note: Moved to Extensions.

I’m writing an extension, but I can’t find this anywhere.

I need to get the current site ID for a MSM site. What can I call in php to get this?

       
Wes Rice's avatar
Wes Rice
103 posts
16 years ago
Wes Rice's avatar Wes Rice

I think I might have found it.

global $PREFS;

$site_id = $PREFS->ini('site_id');
       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Hi, lockwesmonster. This is in the wrong section, I’ll go ahead and move it for you.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Looks like someone moved it, and you found an answer. 😊

       
Wes Rice's avatar
Wes Rice
103 posts
16 years ago
Wes Rice's avatar Wes Rice

Sorry for the wrong section. Should have paid more attention. Thanks though!

       
Brad Street's avatar
Brad Street
239 posts
15 years ago
Brad Street's avatar Brad Street

Anyone know how to access it in EE2.0?

       
Brad Street's avatar
Brad Street
239 posts
15 years ago
Brad Street's avatar Brad Street

Nevermind - think i found it:

$this->EE->config->item('site_id')
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.