Site - MizzouCreative/mizzoumvc GitHub Wiki
Class Reference/Site
Description
Contains site-wide settings and information. Site extends class Base.
Interacting with Site
Available as $this->objSite
inside of extending classes of Main controller, and as Site
inside of a view file.
Usage
Public Properties
Name
String. The site's name as defined in Settings -> General Settings -> Site Title. Same as WordPress get_option('blogname')
URL
String. The site's home URL. Similar to wordpress get_option('home') except it includes ending forward slash (/).
CopyRightYear
Integer. The current year.
ParentThemeURL
String. Parent theme's URL location. Similar to wordpress get_template_directory_uri() except it includes ending forward slash (/).
ChildThemeURL
String. Child theme's URL location. Similar to wordpress get_stylesheet_directory_uri() except it includes ending forward slash (/). If a child theme is not in use, this will be the same value as ParentThemeURL.
ActiveThemeURL
String. Value of ParentThemeURL or ChildThemeURL based on which theme is currently in use.
ParentThemePath
String. Parent theme's server path. Similar to wordpress get_template_directory() except it includes the ending directory separator.
ChildThemePath
String. Child theme's server path. Similar to wordpress get_stylesheet_directory() except it includes the ending directory separator.
ActiveThemePath
String. Value of ParentThemePath or ChildThemePath based on which theme is currently in use.
IsChild
Boolean. Returns true if a child theme is in use, false otherwise. Same as WordPress is_child_theme().
IsMultisite
Boolean. Based on defined constant MULTISITE as defined in wp-config.php
LastModifiedDate
String. If on a page or a single item, will be the date of the last modification to the page/item. Everywhere else it is the last modified date of any item in the *_posts table. Default format is M j, Y.
TrackingCode
String. Deprecated. If the site has a site option of tracking_input, will contain the value.
ParentName
String. If IsMultisite is true, will contain the parent site's name/title.
ParentURL
String.If IsMultisite
is true, will contain the parent site's home URL.
Public Methods
currentPublicMembers()
Array. All currently defined public properties.
getLastModifiedDate( _$strDateFormat_ )
String. Returns the value of LastModifiedDate
but formatted with the date pattern defined from $strDateFormat.
option( _$strOptionName_ )
Mixed. If the framework has been instructed to flatten options (default is true. See config.ini), this will retrieve an option value by option key name ( $strOptionName ).
currentPublicMembers()
Array. Returns a list of all public members of the object.
getSidebar( _$strSidebarName_ )
String. To be deprecated and replace with a Widgets model. Captures and returns the contents from the call to wordpress' dynamic_sidebar function for widget given via $strSidebarname.
Theme Settings
Available as public properties using a settings group/page's slug (as delivered by wordpress
sanitize_title(). This that if your settings
page name contains spaces, you will need to access the settings group via the attribute function in a view file
( attribute(Site,'foo-bar') )
or $this->objSite->{'foo-bar'}
in a controller. Value returned will be an Array of
all the settings in the settings group/page.