Commit b630c137 authored by Erick Hitter's avatar Erick Hitter

Introduce magic getter and make class properties private. Allows for...

Introduce magic getter and make class properties private. Allows for properties to be protected in the future. Since they've been public up to now, all are available through the getter.
parent 5906daad
......@@ -31,30 +31,42 @@ class wp_print_friendly {
/**
* Class variables
*/
var $query_var = 'print';
private $query_var = 'print';
var $ns = 'wp_print_friendly';
private $ns = 'wp_print_friendly';
var $settings_key = 'wpf';
var $settings_defaults = array(
'auto' => false,
'placement' => 'below',
'post_types' => array( 'post', 'page' ),
'print_text' => 'Print this entry',
private $settings_key = 'wpf';
private $settings_defaults = array(
'auto' => false,
'placement' => 'below',
'post_types' => array( 'post', 'page' ),
'print_text' => 'Print this entry',
'print_text_page' => 'Print this page',
'css_class' => 'print_link',
'link_target' => 'same',
'endnotes' => true,
'endnotes_label' => 'Endnotes:'
'css_class' => 'print_link',
'link_target' => 'same',
'endnotes' => true,
'endnotes_label' => 'Endnotes:',
);
var $notice_key = 'wpf_admin_notice_dismissed';
private $notice_key = 'wpf_admin_notice_dismissed';
/**
* Silence is golden!
*/
private function __construct() {}
/**
* Since class variables are private as of v0.6, expose them for external reference
*
* @return mixed
*/
public function __get( $name ) {
if ( property_exists( $this, $name ) )
return $this->$name;
else
return null;
}
/**
* Implement singleton
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment