Sunrise: Class reference – Properties

meta array

Plugin meta. Parsed from main plugin file

basename string

Plugin basename. Example value: plugin-folder/example-plugin.php

slug string

Short plugin name. Based on plugin name from meta section. Example value: pluginname

version string

Plugin version. Based on version from meta section. Example value: 1.0.0

textdomain string

Plugin textdomain. Based on textdomainfrom meta section. Example value: example-plugin-textdomain

name string

Full plugin name. Based on plugin name from meta section. Example value: Plugin name

includes string

Relative path to the plugin includes directory. Example values: includesincludes/core (any folder you want)

views string

Relative path to the plugin views directory. Example values: inc/viewscore/views (any folder you want)

assets string

Relative path to the plugin assets directory. Example values: assetsfiles/assets (any folder you want)

url string

Absolute URL to plugin directory (without trailing slash). Example value: http://example.com/wp-content/plugins/plugin-directory

admin_url string

Absolute URL to plugin options page. Example values: http://example.com/wp-admin/options-general.php?page=pluginname

option string

Option name in wp_options table. This option holds all plugin settings. Example value: pluginname_options

options array

Array with options set. Contains all fields on plugin options page. Example value:

array(
   array(
      'type' => 'opentab',
      'name' => 'General options'
   ),
   ...
   array()
)

args array

Parameters of class constructor. Example value:

array(
   'includes' => 'inc',
   'views' => 'inc/views',
   'assets' => 'assets'
)

settings array

Options page configuration. Example value:

array(
   'parent' => 'options-general.php',
   'menu_title' => 'Plugin name',
   'page_title' => 'Plugin name',
   'capability' => 'manage_options',
   'link' => true
)

How to use properties

$plugin_example = new Sunrise_Plugin_Framework_2( __FILE__ );
echo $plugin_example->version;
// Will output something like '1.0.0'