@@ -54,19 +54,17 @@ public function load_plugin_textdomain() {
54
54
$ locale = apply_filters ( 'plugin_locale ' , get_locale (), $ domain );
55
55
$ mo_file = $ domain . '- ' . get_locale () . '.mo ' ;
56
56
57
- load_textdomain ( $ domain , WP_LANG_DIR . '/ ' + $ domain + '/ ' . $ mo_file );
57
+ load_textdomain ( $ domain , WP_LANG_DIR . '/ ' . $ domain . '/ ' . $ mo_file );
58
58
load_plugin_textdomain ( $ domain , false , plugin_basename ( dirname ( __FILE__ ) ) . '/languages/ ' );
59
59
}
60
60
61
61
/**
62
62
* Attaches the admin menu we'll use for our plugin.
63
63
*/
64
64
public function attach_menu () {
65
- $ domain = REST_API_Plugin_JQuery_Example::TEXT_DOMAIN ;
66
-
67
65
add_menu_page (
68
- __ ( 'REST API Plugin Example Using jQuery ' , $ domain ),
69
- __ ( 'REST API Example ' , $ domain ),
66
+ __ ( 'REST API Plugin Example Using jQuery ' , ' rest-api-plugin-jquery-example ' ),
67
+ __ ( 'REST API Example ' , ' rest-api-plugin-jquery-example ' ),
70
68
'read ' ,
71
69
'rest-api-plugin-jquery-example ' ,
72
70
array ( $ this , 'output_page ' ),
@@ -79,8 +77,6 @@ public function attach_menu() {
79
77
* Outputs the scripts and html for our page.
80
78
*/
81
79
public function output_page () {
82
- $ domain = REST_API_Plugin_JQuery_Example::TEXT_DOMAIN ;
83
-
84
80
wp_enqueue_script ( 'jquery ' );
85
81
86
82
wp_enqueue_script (
@@ -95,26 +91,26 @@ public function output_page() {
95
91
'api_root ' => esc_url_raw ( rest_url () ),
96
92
'api_nonce ' => wp_create_nonce ( 'wp_rest ' ),
97
93
'i18n ' => array (
98
- 'post ' => __ ( 'Post ' , $ domain ),
99
- 'author ' => __ ( 'Author ' , $ domain ),
100
- 'status ' => __ ( 'Status ' , $ domain ),
101
- 'publish ' => __ ( 'Published ' , $ domain ),
102
- 'future ' => __ ( 'Scheduled ' , $ domain ),
103
- 'draft ' => __ ( 'Draft ' , $ domain ),
104
- 'pending ' => __ ( 'Pending Review ' , $ domain ),
105
- 'private ' => __ ( 'Private ' , $ domain ),
106
- 'loading ' => __ ( '(loading) ' , $ domain ),
94
+ 'post ' => __ ( 'Post ' , ' rest-api-plugin-jquery-example ' ),
95
+ 'author ' => __ ( 'Author ' , ' rest-api-plugin-jquery-example ' ),
96
+ 'status ' => __ ( 'Status ' , ' rest-api-plugin-jquery-example ' ),
97
+ 'publish ' => __ ( 'Published ' , ' rest-api-plugin-jquery-example ' ),
98
+ 'future ' => __ ( 'Scheduled ' , ' rest-api-plugin-jquery-example ' ),
99
+ 'draft ' => __ ( 'Draft ' , ' rest-api-plugin-jquery-example ' ),
100
+ 'pending ' => __ ( 'Pending Review ' , ' rest-api-plugin-jquery-example ' ),
101
+ 'private ' => __ ( 'Private ' , ' rest-api-plugin-jquery-example ' ),
102
+ 'loading ' => __ ( '(loading) ' , ' rest-api-plugin-jquery-example ' ),
107
103
)
108
104
) );
109
105
110
106
?>
111
107
<div class="rest-api-example">
112
- <h1><?php _e ( 'REST API Plugin Example Using jQuery ' , $ domain ) ?> </h1>
113
- <p><?php _e ( 'This is the example page for using the REST API from a plugin using jQuery! ' , $ domain ) ?> </p>
108
+ <h1><?php _e ( 'REST API Plugin Example Using jQuery ' , ' rest-api-plugin-jquery-example ' ) ?> </h1>
109
+ <p><?php _e ( 'This is the example page for using the REST API from a plugin using jQuery! ' , ' rest-api-plugin-jquery-example ' ) ?> </p>
114
110
<div id="post-search">
115
111
<form id="search-form" class="search">
116
112
<label>
117
- <?php _e ( 'Search Posts: ' , $ domain ) ?>
113
+ <?php _e ( 'Search Posts: ' , ' rest-api-plugin-jquery-example ' ) ?>
118
114
<input id="search-box" type="search"></input>
119
115
</label>
120
116
<span id="search-message"></span>
0 commit comments