Skip to content
Snippets Groups Projects
Commit e2fa9371 authored by Erick Hitter's avatar Erick Hitter
Browse files

Allow default options to be translated. The balance of the plugin is...

Allow default options to be translated. The balance of the plugin is translation-ready, but this was overlooked.
parent b630c137
No related branches found
No related tags found
No related merge requests found
...@@ -36,17 +36,7 @@ class wp_print_friendly { ...@@ -36,17 +36,7 @@ class wp_print_friendly {
private $ns = 'wp_print_friendly'; private $ns = 'wp_print_friendly';
private $settings_key = 'wpf'; private $settings_key = 'wpf';
private $settings_defaults = array( private $settings_defaults = null; // populated in this::action_plugins_loaded to facilitate translation.
'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:',
);
private $notice_key = 'wpf_admin_notice_dismissed'; private $notice_key = 'wpf_admin_notice_dismissed';
...@@ -113,6 +103,7 @@ class wp_print_friendly { ...@@ -113,6 +103,7 @@ class wp_print_friendly {
/** /**
* Register actions and filters. * Register actions and filters.
* *
* @uses __
* @uses add_action * @uses add_action
* @uses add_filter * @uses add_filter
* @uses get_option * @uses get_option
...@@ -120,6 +111,20 @@ class wp_print_friendly { ...@@ -120,6 +111,20 @@ class wp_print_friendly {
* @return null * @return null
*/ */
public function action_plugins_loaded() { public function action_plugins_loaded() {
// Populate default settings, with translation support
$this->settings_defaults = array(
'auto' => false,
'placement' => 'below',
'post_types' => array( 'post', 'page' ),
'print_text' => __( 'Print this entry', 'wp_print_friendly' ),
'print_text_page' => __( 'Print this page', 'wp_print_friendly' ),
'css_class' => 'print_link',
'link_target' => 'same',
'endnotes' => true,
'endnotes_label' => __( 'Endnotes:', 'wp_print_friendly' ),
);
// Register plugin's remaining actions and filters
add_action( 'init', array( $this, 'action_init' ), 20 ); add_action( 'init', array( $this, 'action_init' ), 20 );
add_action( 'admin_init', array( $this, 'action_admin_init' ) ); add_action( 'admin_init', array( $this, 'action_admin_init' ) );
add_action( 'admin_menu', array( $this, 'action_admin_menu' ) ); add_action( 'admin_menu', array( $this, 'action_admin_menu' ) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment