Say what? - Version 0.9.3

Version Description

Documentation improvements

Download this release

Release Info

Developer leewillis77
Plugin Icon 128x128 Say what?
Version 0.9.3
Comparing to
See all releases

Code changes from version 0.9.2 to 0.9.3

html/say_what_admin_addedit.php CHANGED
@@ -3,6 +3,7 @@
3
  <div id="icon-tools" class="icon32"></div>
4
  <h2><?php _e( 'Text changes', 'say_what' ); ?></h2>
5
 
 
6
  <form action="tools.php?page=say_what_admin&amp;say_what_action=addedit" method="post">
7
  <input type="hidden" name="say_what_save" value="1">
8
  <?php wp_nonce_field( 'swaddedit', 'nonce' ); ?>
@@ -12,8 +13,12 @@
12
  <p>
13
  <label for="say_what_orig_string"><?php _e( 'Original string', 'say_what' ); ?></label><br/>
14
  <input type="text" name="say_what_orig_string" size="120" value="<?php echo esc_attr( $replacement->orig_string ) ?>"><br/>
15
- <label for="say_what_domain"><?php _e( 'Domain', 'say_what' ); ?></label><br/>
 
 
16
  <input type="text" name="say_what_domain" value="<?php echo esc_attr( $replacement->domain ); ?>"><br/>
 
 
17
  <label for="say_what_replacement_string"><?php _e( 'Replacement string', 'say_what' ); ?></label><br/>
18
  <input type="text" name="say_what_replacement_string" size="120" value="<?php echo esc_attr( $replacement->replacement_string ); ?>"><br/>
19
  </p>
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&amp;say_what_action=addedit" method="post">
8
  <input type="hidden" name="say_what_save" value="1">
9
  <?php wp_nonce_field( 'swaddedit', 'nonce' ); ?>
13
  <p>
14
  <label for="say_what_orig_string"><?php _e( 'Original string', 'say_what' ); ?></label><br/>
15
  <input type="text" name="say_what_orig_string" size="120" value="<?php echo esc_attr( $replacement->orig_string ) ?>"><br/>
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">&nbsp;</i></a><br/>
19
  <input type="text" name="say_what_domain" value="<?php echo esc_attr( $replacement->domain ); ?>"><br/>
20
+ </p>
21
+ <p>
22
  <label for="say_what_replacement_string"><?php _e( 'Replacement string', 'say_what' ); ?></label><br/>
23
  <input type="text" name="say_what_replacement_string" size="120" value="<?php echo esc_attr( $replacement->replacement_string ); ?>"><br/>
24
  </p>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Say what? - Easy string replacements ===
2
  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, replace, swap, override
5
  Requires at least: 3.5
6
  Tested up to: 3.5.1
7
- Stable tag: 0.9.2
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!
@@ -38,6 +38,9 @@ You can either have a guess, or checkout the plugin in question's source code, t
38
 
39
  == Changelog ==
40
 
 
 
 
41
  = 0.9.2 =
42
  Avoid wpdb->prepare warning
43
  Minor admin fixes, don't double translate strings
1
+ === Say what? ===
2
  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: 3.5
6
  Tested up to: 3.5.1
7
+ Stable tag: 0.9.3
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!
38
 
39
  == Changelog ==
40
 
41
+ = 0.9.3 =
42
+ Documentation improvements
43
+
44
  = 0.9.2 =
45
  Avoid wpdb->prepare warning
46
  Minor admin fixes, don't double translate strings
say-what-frontend.php CHANGED
@@ -1,54 +1,36 @@
1
  <?php
2
 
3
-
4
-
5
  if ( ! defined( 'ABSPATH' ) )
6
  exit; // Exit if accessed directly
7
 
8
-
9
  /**
10
  * The frontend class, responsible for performing the actual replacements
11
  */
12
  class say_what_frontend {
13
 
14
-
15
-
16
  private $replacements;
17
 
18
-
19
-
20
  /**
21
  * Read the settings in and put them into a format optimised for the final filter
22
  */
23
  function __construct($settings) {
24
-
25
  foreach ( $settings->replacements as $key => $value ) {
26
-
27
  if ( empty ( $value['domain'] ) )
28
  $value['domain'] = 'default';
29
-
30
  $this->replacements[$value['domain']][$value['orig_string']] = $value['replacement_string'];
31
  }
32
-
33
  add_filter ( 'gettext', array ( $this, 'gettext' ), 10, 3 );
34
-
35
  }
36
 
37
-
38
-
39
  /**
40
  * The main function - optionally perform a string replacement
41
  */
42
  function gettext( $translated, $original, $domain ) {
43
-
44
  if ( isset ( $this->replacements[$domain][$original] ) ) {
45
  return $this->replacements[$domain][$original];
46
  } else {
47
  return $translated;
48
  }
49
-
50
  }
51
 
52
-
53
-
54
  }
1
  <?php
2
 
 
 
3
  if ( ! defined( 'ABSPATH' ) )
4
  exit; // Exit if accessed directly
5
 
 
6
  /**
7
  * The frontend class, responsible for performing the actual replacements
8
  */
9
  class say_what_frontend {
10
 
 
 
11
  private $replacements;
12
 
 
 
13
  /**
14
  * Read the settings in and put them into a format optimised for the final filter
15
  */
16
  function __construct($settings) {
 
17
  foreach ( $settings->replacements as $key => $value ) {
 
18
  if ( empty ( $value['domain'] ) )
19
  $value['domain'] = 'default';
 
20
  $this->replacements[$value['domain']][$value['orig_string']] = $value['replacement_string'];
21
  }
 
22
  add_filter ( 'gettext', array ( $this, 'gettext' ), 10, 3 );
 
23
  }
24
 
 
 
25
  /**
26
  * The main function - optionally perform a string replacement
27
  */
28
  function gettext( $translated, $original, $domain ) {
 
29
  if ( isset ( $this->replacements[$domain][$original] ) ) {
30
  return $this->replacements[$domain][$original];
31
  } else {
32
  return $translated;
33
  }
 
34
  }
35
 
 
 
36
  }
say-what-list-table.class.php CHANGED
@@ -47,12 +47,12 @@ class say_what_list_table extends WP_List_Table {
47
 
48
  $columns = array(
49
  /*'cb' => 'Checkboxes',*/
50
- 'string_id' => 'String replacement ID (Internal)',
51
- 'orig_string' => __( 'Original string', 'say_what' ),
52
- 'domain' => __( 'Domain', 'say_what' ),
53
- 'replacement_string' => __( 'Replacement string', 'say_what' ),
54
- 'edit_links' => _x( '', 'Header for edit links on admin list table', 'say_what' ),
55
- 'delete_links' => _x( '', 'Header for delete links on admin list table', 'say_what' ),
56
  );
57
  return $columns;
58
 
47
 
48
  $columns = array(
49
  /*'cb' => 'Checkboxes',*/
50
+ 'string_id' => 'String replacement ID (Internal)',
51
+ 'orig_string' => __( 'Original string', 'say_what' ),
52
+ 'domain' => __( 'Text domain', 'say_what' ),
53
+ 'replacement_string' => __( 'Replacement string', 'say_what' ),
54
+ 'edit_links' => _x( '', 'Header for edit links on admin list table', 'say_what' ),
55
+ 'delete_links' => _x( '', 'Header for delete links on admin list table', 'say_what' ),
56
  );
57
  return $columns;
58
 
say-what.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /*
4
- Plugin Name: Say What? - Easy string replacements
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: 0.9.2
8
  Author: Lee Willis
9
  Author URI: http://www.leewillis.co.uk/
10
  */
1
  <?php
2
 
3
  /*
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: 0.9.3
8
  Author: Lee Willis
9
  Author URI: http://www.leewillis.co.uk/
10
  */