3 Matching Annotations
  1. Sep 2020
  2. Mar 2020
    1. This is where the incredibly useful gettext filter comes in. If you take a peek at your plugin's code you'll see strings like this: .gist table { margin-bottom: 0; } <?php _e( 'Related Products', 'woocommerce' ); ?> view raw sample-translatable-string.php hosted with by GitHub You can easily translate these strings by adding a filter to your functions.php file: .gist table { margin-bottom: 0; } <?php /** * Change text strings * * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext */ function my_text_strings( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Related Products' : $translated_text = __( 'Check out these related products', 'woocommerce' ); break; } return $translated_text; } add_filter( 'gettext', 'my_text_strings', 20, 3 );
  3. Nov 2019
    1. Registering new services to the Injector If you've created a module using React, it's a good idea to afford other developers an API to enhance those components, forms, and state. To do that, simply register them with Injector.