Version Description
- Fix issue adding more strings after downgrade from Pro
- Update text domain of plugin to match wordpress.org guidelines to aid translations
Download this release
Release Info
Developer | leewillis77 |
Plugin | Say what? |
Version | 1.9.0 |
Comparing to | |
See all releases |
Code changes from version 1.8.2 to 1.9.0
- html/say-what-admin-addedit.php +6 -6
- html/say-what-admin-delete.php +4 -4
- html/say-what-admin-list.php +1 -1
- readme.txt +6 -2
- say-what-admin.php +29 -23
- say-what-list-table.class.php +12 -12
- say-what.php +15 -5
html/say-what-admin-addedit.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
|
2 |
<div class="wrap">
|
3 |
<div id="icon-tools" class="icon32"></div>
|
4 |
-
<h2><?php _e( 'Text changes', '
|
5 |
|
6 |
<p><?php _e( "Fill in the details of the original translatable string, the string's text domain, and the string you would like to use instead. For more information check out the <a href='http://plugins.leewillis.co.uk/doc_post/adding-string-replacement/'>getting started guide</a>." ); ?></p>
|
7 |
<form action="tools.php?page=say_what_admin&say_what_action=addedit" method="post">
|
@@ -11,23 +11,23 @@
|
|
11 |
<input type="hidden" name="say_what_string_id" value="<?php echo esc_attr( htmlspecialchars( $replacement->string_id ) ); ?>">
|
12 |
<?php endif; ?>
|
13 |
<p>
|
14 |
-
<label for="say_what_orig_string"><?php _e( 'Original string', '
|
15 |
<textarea class="say_what_orig_string" name="say_what_orig_string" rows="1" cols="120"><?php echo esc_textarea( $replacement->orig_string ); ?></textarea>
|
16 |
</p>
|
17 |
<p>
|
18 |
-
<label for="say_what_domain"><?php _e( 'Text domain', '
|
19 |
<input type="text" name="say_what_domain" size="30" value="<?php echo esc_attr( htmlspecialchars( $replacement->domain ) ); ?>"><br/>
|
20 |
</p>
|
21 |
<p>
|
22 |
-
<label for="say_what_context"><?php _e( 'Text context', '
|
23 |
<input type="text" name="say_what_context" size="30" value="<?php echo esc_attr( htmlspecialchars( $replacement->context ) ); ?>"><br/>
|
24 |
</p>
|
25 |
<p>
|
26 |
-
<label for="say_what_replacement_string"><?php _e( 'Replacement string', '
|
27 |
<textarea class="say_what_replacement_string" name="say_what_replacement_string" cols="120" rows="1"><?php echo esc_textarea( $replacement->replacement_string ); ?></textarea>
|
28 |
</p>
|
29 |
<p>
|
30 |
-
<input type="submit" class="button-primary" value="<?php ! empty( $replacement->string_id ) ? _e( 'Update', '
|
31 |
</p>
|
32 |
</form>
|
33 |
|
1 |
|
2 |
<div class="wrap">
|
3 |
<div id="icon-tools" class="icon32"></div>
|
4 |
+
<h2><?php _e( 'Text changes', 'say-what' ); ?></h2>
|
5 |
|
6 |
<p><?php _e( "Fill in the details of the original translatable string, the string's text domain, and the string you would like to use instead. For more information check out the <a href='http://plugins.leewillis.co.uk/doc_post/adding-string-replacement/'>getting started guide</a>." ); ?></p>
|
7 |
<form action="tools.php?page=say_what_admin&say_what_action=addedit" method="post">
|
11 |
<input type="hidden" name="say_what_string_id" value="<?php echo esc_attr( htmlspecialchars( $replacement->string_id ) ); ?>">
|
12 |
<?php endif; ?>
|
13 |
<p>
|
14 |
+
<label for="say_what_orig_string"><?php _e( 'Original string', 'say-what' ); ?></label><br/>
|
15 |
<textarea class="say_what_orig_string" name="say_what_orig_string" rows="1" cols="120"><?php echo esc_textarea( $replacement->orig_string ); ?></textarea>
|
16 |
</p>
|
17 |
<p>
|
18 |
+
<label for="say_what_domain"><?php _e( 'Text domain', 'say-what' ); ?></label> <a href="http://plugins.leewillis.co.uk/doc_post/adding-string-replacement/"><i class="dashicons dashicons-info"> </i></a><br/>
|
19 |
<input type="text" name="say_what_domain" size="30" value="<?php echo esc_attr( htmlspecialchars( $replacement->domain ) ); ?>"><br/>
|
20 |
</p>
|
21 |
<p>
|
22 |
+
<label for="say_what_context"><?php _e( 'Text context', 'say-what' ); ?></label> <a href="http://plugins.leewillis.co.uk/doc_post/replacing-wordpress-strings-context/"><i class="dashicons dashicons-info"> </i></a><br/>
|
23 |
<input type="text" name="say_what_context" size="30" value="<?php echo esc_attr( htmlspecialchars( $replacement->context ) ); ?>"><br/>
|
24 |
</p>
|
25 |
<p>
|
26 |
+
<label for="say_what_replacement_string"><?php _e( 'Replacement string', 'say-what' ); ?></label><br/>
|
27 |
<textarea class="say_what_replacement_string" name="say_what_replacement_string" cols="120" rows="1"><?php echo esc_textarea( $replacement->replacement_string ); ?></textarea>
|
28 |
</p>
|
29 |
<p>
|
30 |
+
<input type="submit" class="button-primary" value="<?php ! empty( $replacement->string_id ) ? _e( 'Update', 'say-what' ) : _e( 'Add', 'say-what' ); ?>">
|
31 |
</p>
|
32 |
</form>
|
33 |
|
html/say-what-admin-delete.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<div class="wrap">
|
2 |
<div id="icon-tools" class="icon32"></div>
|
3 |
-
<h2><?php _e( 'Text changes', '
|
4 |
|
5 |
-
<p><?php printf( __( 'Are you sure you want to delete the replacement string for "%s"?', '
|
6 |
<p>
|
7 |
-
<a href="tools.php?page=say_what_admin&say_what_action=delete-confirmed&id=<?php echo urlencode( $_GET['id'] ); ?>&nonce=<?php echo urlencode( $_GET['nonce'] ); ?>" class="button"><?php _e( 'Yes', '
|
8 |
-
</div>
|
1 |
<div class="wrap">
|
2 |
<div id="icon-tools" class="icon32"></div>
|
3 |
+
<h2><?php _e( 'Text changes', 'say-what' ); ?></h2>
|
4 |
|
5 |
+
<p><?php printf( __( 'Are you sure you want to delete the replacement string for "%s"?', 'say-what' ), esc_html( $replacement->orig_string ) ); ?></p>
|
6 |
<p>
|
7 |
+
<a href="tools.php?page=say_what_admin&say_what_action=delete-confirmed&id=<?php echo urlencode( $_GET['id'] ); ?>&nonce=<?php echo urlencode( $_GET['nonce'] ); ?>" class="button"><?php _e( 'Yes', 'say-what' ); ?></a> <a href="tools.php?page=say_what_admin" class="button button-primary"><?php _e( 'No', 'say-what' ); ?></a>
|
8 |
+
</div>
|
html/say-what-admin-list.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class="wrap">
|
2 |
<div id="icon-tools" class="icon32"></div>
|
3 |
-
<h2><?php _e( 'Text changes', '
|
4 |
<?php
|
5 |
$list_table_instance = new SayWhatListTable( $this->settings );
|
6 |
$list_table_instance->prepare_items();
|
1 |
<div class="wrap">
|
2 |
<div id="icon-tools" class="icon32"></div>
|
3 |
+
<h2><?php _e( 'Text changes', 'say-what' ); ?><a href="tools.php?page=say_what_admin&say_what_action=addedit" class="add-new-h2"><?php _e( 'Add New', 'say-what' ); ?></a></h2>
|
4 |
<?php
|
5 |
$list_table_instance = new SayWhatListTable( $this->settings );
|
6 |
$list_table_instance->prepare_items();
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: leewillis77
|
|
3 |
Donate link: http://www.leewillis.co.uk/wordpress-plugins/?utm_source=wordpress&utm_medium=www&utm_campaign=say-what
|
4 |
Tags: string, change, translation
|
5 |
Requires at least: 4.3
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
== Description ==
|
10 |
An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code. Simply enter the current string, and what you want to replace it with and the plugin will automatically do the rest!
|
@@ -58,6 +58,10 @@ Not in the free plugin, however this is available in the [Pro version of the plu
|
|
58 |
|
59 |
== Changelog ==
|
60 |
|
|
|
|
|
|
|
|
|
61 |
= 1.8.2 =
|
62 |
* Documentation updates only
|
63 |
|
3 |
Donate link: http://www.leewillis.co.uk/wordpress-plugins/?utm_source=wordpress&utm_medium=www&utm_campaign=say-what
|
4 |
Tags: string, change, translation
|
5 |
Requires at least: 4.3
|
6 |
+
Tested up to: 4.8
|
7 |
+
Stable tag: 1.9.0
|
8 |
|
9 |
== Description ==
|
10 |
An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code. Simply enter the current string, and what you want to replace it with and the plugin will automatically do the rest!
|
58 |
|
59 |
== Changelog ==
|
60 |
|
61 |
+
= 1.9.0 =
|
62 |
+
* Fix issue adding more strings after downgrade from Pro
|
63 |
+
* Update text domain of plugin to match wordpress.org guidelines to aid translations
|
64 |
+
|
65 |
= 1.8.2 =
|
66 |
* Documentation updates only
|
67 |
|
say-what-admin.php
CHANGED
@@ -25,10 +25,10 @@ class SayWhatAdmin {
|
|
25 |
* Admin init actions. Takes care of saving stuff before redirects
|
26 |
*/
|
27 |
public function admin_init() {
|
28 |
-
if ( isset
|
29 |
$this->save();
|
30 |
}
|
31 |
-
if ( isset
|
32 |
$this->admin_delete_confirmed();
|
33 |
}
|
34 |
}
|
@@ -42,7 +42,7 @@ class SayWhatAdmin {
|
|
42 |
public function add_upgrade_link( $links ) {
|
43 |
array_unshift(
|
44 |
$links,
|
45 |
-
'<a href="' . admin_url( 'tools.php?page=say_what_admin' ) . '">' . __( 'Settings', '
|
46 |
);
|
47 |
$links[] = '<a href="http://plugins.leewillis.co.uk/downloads/say-what-pro/?utm_source=wporg&utm_medium=plugin&utm_campaign=saywhatproupgrade"><strong>Upgrade to Pro</strong></a>';
|
48 |
return $links;
|
@@ -53,8 +53,8 @@ class SayWhatAdmin {
|
|
53 |
public function admin_menu() {
|
54 |
if ( current_user_can( 'manage_options' ) ) {
|
55 |
$page = add_management_page(
|
56 |
-
__( 'Text changes', '
|
57 |
-
__( 'Text changes', '
|
58 |
'manage_options',
|
59 |
'say_what_admin',
|
60 |
array( $this, 'admin' )
|
@@ -96,8 +96,8 @@ class SayWhatAdmin {
|
|
96 |
* Render the list of currently configured replacement strings
|
97 |
*/
|
98 |
public function admin_list() {
|
99 |
-
require_once
|
100 |
-
require_once('html/say-what-admin-list.php');
|
101 |
}
|
102 |
|
103 |
/**
|
@@ -106,16 +106,16 @@ class SayWhatAdmin {
|
|
106 |
public function admin_delete() {
|
107 |
global $wpdb, $table_prefix;
|
108 |
if ( ! wp_verify_nonce( $_GET['nonce'], 'swdelete' ) ) {
|
109 |
-
wp_die( __( 'Did you really mean to do that? Please go back and try again.', '
|
110 |
}
|
111 |
-
if ( isset
|
112 |
$sql = "SELECT * FROM {$table_prefix}say_what_strings WHERE string_id = %d";
|
113 |
$replacement = $wpdb->get_row( $wpdb->prepare( $sql, $_GET['id'] ) );
|
114 |
}
|
115 |
if ( ! $replacement ) {
|
116 |
-
wp_die( __( 'Did you really mean to do that? Please go back and try again.', '
|
117 |
}
|
118 |
-
require_once('html/say-what-admin-delete.php');
|
119 |
}
|
120 |
|
121 |
/**
|
@@ -125,7 +125,7 @@ class SayWhatAdmin {
|
|
125 |
global $wpdb, $table_prefix;
|
126 |
if ( ! wp_verify_nonce( $_GET['nonce'], 'swdelete' ) ||
|
127 |
empty( $_GET['id'] ) ) {
|
128 |
-
wp_die( __( 'Did you really mean to do that? Please go back and try again.', '
|
129 |
}
|
130 |
$sql = "DELETE FROM {$table_prefix}say_what_strings WHERE string_id = %d";
|
131 |
$wpdb->query( $wpdb->prepare( $sql, $_GET['id'] ) );
|
@@ -139,7 +139,7 @@ class SayWhatAdmin {
|
|
139 |
public function admin_addedit() {
|
140 |
global $wpdb, $table_prefix;
|
141 |
$replacement = false;
|
142 |
-
if ( isset
|
143 |
$sql = "SELECT * FROM {$table_prefix}say_what_strings WHERE string_id = %d";
|
144 |
$replacement = $wpdb->get_row( $wpdb->prepare( $sql, $_GET['id'] ) );
|
145 |
}
|
@@ -151,14 +151,14 @@ class SayWhatAdmin {
|
|
151 |
$replacement->domain = '';
|
152 |
$replacement->context = '';
|
153 |
}
|
154 |
-
require_once('html/say-what-admin-addedit.php');
|
155 |
}
|
156 |
|
157 |
/**
|
158 |
* Strip CRs out of strings. array_walk() callback.
|
159 |
*/
|
160 |
private function strip_cr_callback( &$val, $key ) {
|
161 |
-
$val = str_replace("\r\n", "\n", $val);
|
162 |
}
|
163 |
|
164 |
/**
|
@@ -168,11 +168,11 @@ class SayWhatAdmin {
|
|
168 |
private function save() {
|
169 |
global $wpdb, $table_prefix;
|
170 |
if ( ! wp_verify_nonce( $_POST['nonce'], 'swaddedit' ) ) {
|
171 |
-
wp_die( __( 'Did you really mean to do that? Please go back and try again.', '
|
172 |
}
|
173 |
$_POST = stripslashes_deep( $_POST );
|
174 |
array_walk( $_POST, array( $this, 'strip_cr_callback' ) );
|
175 |
-
if ( isset
|
176 |
$sql = "UPDATE {$table_prefix}say_what_strings
|
177 |
SET orig_string = %s,
|
178 |
replacement_string = %s,
|
@@ -191,11 +191,18 @@ class SayWhatAdmin {
|
|
191 |
);
|
192 |
} else {
|
193 |
$sql = "INSERT INTO {$table_prefix}say_what_strings
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
$wpdb->query(
|
201 |
$wpdb->prepare(
|
@@ -210,5 +217,4 @@ class SayWhatAdmin {
|
|
210 |
wp_redirect( 'tools.php?page=say_what_admin', '303' );
|
211 |
die();
|
212 |
}
|
213 |
-
|
214 |
}
|
25 |
* Admin init actions. Takes care of saving stuff before redirects
|
26 |
*/
|
27 |
public function admin_init() {
|
28 |
+
if ( isset( $_POST['say_what_save'] ) ) {
|
29 |
$this->save();
|
30 |
}
|
31 |
+
if ( isset( $_GET['say_what_action'] ) && ( 'delete-confirmed' == $_GET['say_what_action'] ) ) {
|
32 |
$this->admin_delete_confirmed();
|
33 |
}
|
34 |
}
|
42 |
public function add_upgrade_link( $links ) {
|
43 |
array_unshift(
|
44 |
$links,
|
45 |
+
'<a href="' . admin_url( 'tools.php?page=say_what_admin' ) . '">' . __( 'Settings', 'say-what' ) . '</a>'
|
46 |
);
|
47 |
$links[] = '<a href="http://plugins.leewillis.co.uk/downloads/say-what-pro/?utm_source=wporg&utm_medium=plugin&utm_campaign=saywhatproupgrade"><strong>Upgrade to Pro</strong></a>';
|
48 |
return $links;
|
53 |
public function admin_menu() {
|
54 |
if ( current_user_can( 'manage_options' ) ) {
|
55 |
$page = add_management_page(
|
56 |
+
__( 'Text changes', 'say-what' ),
|
57 |
+
__( 'Text changes', 'say-what' ),
|
58 |
'manage_options',
|
59 |
'say_what_admin',
|
60 |
array( $this, 'admin' )
|
96 |
* Render the list of currently configured replacement strings
|
97 |
*/
|
98 |
public function admin_list() {
|
99 |
+
require_once( 'say-what-list-table.class.php' );
|
100 |
+
require_once( 'html/say-what-admin-list.php' );
|
101 |
}
|
102 |
|
103 |
/**
|
106 |
public function admin_delete() {
|
107 |
global $wpdb, $table_prefix;
|
108 |
if ( ! wp_verify_nonce( $_GET['nonce'], 'swdelete' ) ) {
|
109 |
+
wp_die( __( 'Did you really mean to do that? Please go back and try again.', 'say-what' ) );
|
110 |
}
|
111 |
+
if ( isset( $_GET['id'] ) ) {
|
112 |
$sql = "SELECT * FROM {$table_prefix}say_what_strings WHERE string_id = %d";
|
113 |
$replacement = $wpdb->get_row( $wpdb->prepare( $sql, $_GET['id'] ) );
|
114 |
}
|
115 |
if ( ! $replacement ) {
|
116 |
+
wp_die( __( 'Did you really mean to do that? Please go back and try again.', 'say-what' ) );
|
117 |
}
|
118 |
+
require_once( 'html/say-what-admin-delete.php' );
|
119 |
}
|
120 |
|
121 |
/**
|
125 |
global $wpdb, $table_prefix;
|
126 |
if ( ! wp_verify_nonce( $_GET['nonce'], 'swdelete' ) ||
|
127 |
empty( $_GET['id'] ) ) {
|
128 |
+
wp_die( __( 'Did you really mean to do that? Please go back and try again.', 'say-what' ) );
|
129 |
}
|
130 |
$sql = "DELETE FROM {$table_prefix}say_what_strings WHERE string_id = %d";
|
131 |
$wpdb->query( $wpdb->prepare( $sql, $_GET['id'] ) );
|
139 |
public function admin_addedit() {
|
140 |
global $wpdb, $table_prefix;
|
141 |
$replacement = false;
|
142 |
+
if ( isset( $_GET['id'] ) ) {
|
143 |
$sql = "SELECT * FROM {$table_prefix}say_what_strings WHERE string_id = %d";
|
144 |
$replacement = $wpdb->get_row( $wpdb->prepare( $sql, $_GET['id'] ) );
|
145 |
}
|
151 |
$replacement->domain = '';
|
152 |
$replacement->context = '';
|
153 |
}
|
154 |
+
require_once( 'html/say-what-admin-addedit.php' );
|
155 |
}
|
156 |
|
157 |
/**
|
158 |
* Strip CRs out of strings. array_walk() callback.
|
159 |
*/
|
160 |
private function strip_cr_callback( &$val, $key ) {
|
161 |
+
$val = str_replace( "\r\n", "\n", $val );
|
162 |
}
|
163 |
|
164 |
/**
|
168 |
private function save() {
|
169 |
global $wpdb, $table_prefix;
|
170 |
if ( ! wp_verify_nonce( $_POST['nonce'], 'swaddedit' ) ) {
|
171 |
+
wp_die( __( 'Did you really mean to do that? Please go back and try again.', 'say-what' ) );
|
172 |
}
|
173 |
$_POST = stripslashes_deep( $_POST );
|
174 |
array_walk( $_POST, array( $this, 'strip_cr_callback' ) );
|
175 |
+
if ( isset( $_POST['say_what_string_id'] ) ) {
|
176 |
$sql = "UPDATE {$table_prefix}say_what_strings
|
177 |
SET orig_string = %s,
|
178 |
replacement_string = %s,
|
191 |
);
|
192 |
} else {
|
193 |
$sql = "INSERT INTO {$table_prefix}say_what_strings
|
194 |
+
(
|
195 |
+
orig_string,
|
196 |
+
domain,
|
197 |
+
replacement_string,
|
198 |
+
context
|
199 |
+
)
|
200 |
+
VALUES (
|
201 |
+
%s,
|
202 |
+
%s,
|
203 |
+
%s,
|
204 |
+
%s
|
205 |
+
)";
|
206 |
|
207 |
$wpdb->query(
|
208 |
$wpdb->prepare(
|
217 |
wp_redirect( 'tools.php?page=say_what_admin', '303' );
|
218 |
die();
|
219 |
}
|
|
|
220 |
}
|
say-what-list-table.class.php
CHANGED
@@ -23,7 +23,7 @@ class SayWhatListTable extends WP_List_Table {
|
|
23 |
* Description shown when no replacements configured
|
24 |
*/
|
25 |
function no_items() {
|
26 |
-
_e( 'No string replacements configured yet.', '
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -34,12 +34,12 @@ class SayWhatListTable extends WP_List_Table {
|
|
34 |
$columns = array(
|
35 |
/*'cb' => 'Checkboxes',*/
|
36 |
'string_id' => 'String replacement ID (Internal)',
|
37 |
-
'orig_string' => __( 'Original string', '
|
38 |
-
'domain' => __( 'Text domain', '
|
39 |
-
'context' => __( 'Text context', '
|
40 |
-
'replacement_string' => __( 'Replacement string', '
|
41 |
-
'edit_links' => _x( '', 'Header for edit links on admin list table', '
|
42 |
-
'delete_links' => _x( '', 'Header for delete links on admin list table', '
|
43 |
);
|
44 |
return $columns;
|
45 |
}
|
@@ -55,7 +55,7 @@ class SayWhatListTable extends WP_List_Table {
|
|
55 |
$hidden = array( 'string_id' );
|
56 |
$sortable = $this->get_sortable_columns();
|
57 |
$this->_column_headers = array( $columns, $hidden, $sortable );
|
58 |
-
//$this->search_box(__('Search', '
|
59 |
|
60 |
// We don't use the replacements from the settings object, we query them separately to make
|
61 |
// ordering/searhing/pagination easier. This may turn out bad if people have "lots"
|
@@ -88,7 +88,7 @@ class SayWhatListTable extends WP_List_Table {
|
|
88 |
*/
|
89 |
function get_bulk_actions() {
|
90 |
// @TODO - implement bulk actions
|
91 |
-
//$actions = array ( 'delete' => __( 'Delete', '
|
92 |
return array();
|
93 |
}
|
94 |
|
@@ -115,7 +115,7 @@ class SayWhatListTable extends WP_List_Table {
|
|
115 |
'&nonce=' .
|
116 |
urlencode( wp_create_nonce( 'swaddedit' ) ) .
|
117 |
'">' .
|
118 |
-
__( 'Edit', '
|
119 |
'</a>';
|
120 |
}
|
121 |
|
@@ -128,8 +128,8 @@ class SayWhatListTable extends WP_List_Table {
|
|
128 |
'&nonce=' .
|
129 |
urlencode( wp_create_nonce( 'swdelete' ) ) .
|
130 |
'">' .
|
131 |
-
__( 'Delete', '
|
132 |
'</a>';
|
133 |
}
|
134 |
|
135 |
-
}
|
23 |
* Description shown when no replacements configured
|
24 |
*/
|
25 |
function no_items() {
|
26 |
+
_e( 'No string replacements configured yet.', 'say-what' );
|
27 |
}
|
28 |
|
29 |
/**
|
34 |
$columns = array(
|
35 |
/*'cb' => 'Checkboxes',*/
|
36 |
'string_id' => 'String replacement ID (Internal)',
|
37 |
+
'orig_string' => __( 'Original string', 'say-what' ),
|
38 |
+
'domain' => __( 'Text domain', 'say-what' ),
|
39 |
+
'context' => __( 'Text context', 'say-what' ),
|
40 |
+
'replacement_string' => __( 'Replacement string', 'say-what' ),
|
41 |
+
'edit_links' => _x( '', 'Header for edit links on admin list table', 'say-what' ),
|
42 |
+
'delete_links' => _x( '', 'Header for delete links on admin list table', 'say-what' ),
|
43 |
);
|
44 |
return $columns;
|
45 |
}
|
55 |
$hidden = array( 'string_id' );
|
56 |
$sortable = $this->get_sortable_columns();
|
57 |
$this->_column_headers = array( $columns, $hidden, $sortable );
|
58 |
+
//$this->search_box(__('Search', 'say-what'), 'search_id'); // FIXME - implement searching
|
59 |
|
60 |
// We don't use the replacements from the settings object, we query them separately to make
|
61 |
// ordering/searhing/pagination easier. This may turn out bad if people have "lots"
|
88 |
*/
|
89 |
function get_bulk_actions() {
|
90 |
// @TODO - implement bulk actions
|
91 |
+
//$actions = array ( 'delete' => __( 'Delete', 'say-what' ) );
|
92 |
return array();
|
93 |
}
|
94 |
|
115 |
'&nonce=' .
|
116 |
urlencode( wp_create_nonce( 'swaddedit' ) ) .
|
117 |
'">' .
|
118 |
+
__( 'Edit', 'say-what' ) .
|
119 |
'</a>';
|
120 |
}
|
121 |
|
128 |
'&nonce=' .
|
129 |
urlencode( wp_create_nonce( 'swdelete' ) ) .
|
130 |
'">' .
|
131 |
+
__( 'Delete', 'say-what' ) .
|
132 |
'</a>';
|
133 |
}
|
134 |
|
135 |
+
}
|
say-what.php
CHANGED
@@ -4,10 +4,10 @@
|
|
4 |
Plugin Name: Say What?
|
5 |
Plugin URI: https://github.com/leewillis77/say-what
|
6 |
Description: An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code
|
7 |
-
Version: 1.
|
8 |
Author: Lee Willis
|
9 |
Author URI: http://plugins.leewillis.co.uk/
|
10 |
-
Text Domain:
|
11 |
*/
|
12 |
|
13 |
/**
|
@@ -67,6 +67,7 @@ class SayWhat {
|
|
67 |
}
|
68 |
add_action( 'init', array( $this, 'init' ) );
|
69 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
|
|
70 |
}
|
71 |
|
72 |
/**
|
@@ -74,9 +75,18 @@ class SayWhat {
|
|
74 |
* Set up translation for the plugin itself.
|
75 |
*/
|
76 |
public function init() {
|
77 |
-
$locale = apply_filters( 'plugin_locale', get_locale(), '
|
78 |
-
load_textdomain( '
|
79 |
-
load_plugin_textdomain( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
/**
|
4 |
Plugin Name: Say What?
|
5 |
Plugin URI: https://github.com/leewillis77/say-what
|
6 |
Description: An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code
|
7 |
+
Version: 1.9.0
|
8 |
Author: Lee Willis
|
9 |
Author URI: http://plugins.leewillis.co.uk/
|
10 |
+
Text Domain: say-what
|
11 |
*/
|
12 |
|
13 |
/**
|
67 |
}
|
68 |
add_action( 'init', array( $this, 'init' ) );
|
69 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
70 |
+
add_filter( 'say_what_domain_aliases', array( $this, 'register_domain_alias' ) );
|
71 |
}
|
72 |
|
73 |
/**
|
75 |
* Set up translation for the plugin itself.
|
76 |
*/
|
77 |
public function init() {
|
78 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), 'say-what' );
|
79 |
+
load_textdomain( 'say-what', WP_LANG_DIR . '/say_what/say-what-' . $locale . '.mo' );
|
80 |
+
load_plugin_textdomain( 'say-what', false, basename( dirname( __FILE__ ) ) . '/languages/' );
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Register an alias for our old text domain so any existing replacements
|
85 |
+
* keep working.
|
86 |
+
*/
|
87 |
+
public function register_domain_alias( $aliases ) {
|
88 |
+
$aliases['say-what'][] = 'say_what';
|
89 |
+
return $aliases;
|
90 |
}
|
91 |
|
92 |
/**
|