Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14853

Re: php _e question

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: php _e question
Date 2015-02-04 05:22 +0100
Message-ID <54D19E8F.3080405@arnowelzel.de> (permalink)
References <e2907cd1-e267-4b14-a298-3002f7f2dca6@googlegroups.com>

Show all headers | View raw


pigsfoot.trotter@gmail.com schrieb am 2015-01-10 um 19:09:
> Hi,
> I have some code within an ecommerce shop that i'm using as follows
> 
> <?php _e( 'No products were found matching your selection.', 'woocommerce' ); ?></p>
> 
> Is it possible to replace the 'No products were found matching your selection.'
> 
> with text, a hyperlink and an image?

Well - this is not really PHP specific but more a WordPress questions,
as Woocommerce is based on WordPress.

You can just put the required stuff in there, but don't forget to update
the translation as well (the respectiv PO/MO files) if English is not
the only language you use (I recommend using the Loco Translate plugin
for doing this in the WordPress backend):

<?php _e( 'No products were found matching your selection. <a
href="someurl">Here you find something else</a> <img src="foobar" alt=""
/>', 'woocommerce' ); ?></p>

JFTR:

_e() is a function provided by WordPress to output translation of a text
defined by the - either it will use the given text itself (literally -
so take care not to create invalid HTML with the text) or the
translation for the current language of the site if available.

Also see: <http://codex.wordpress.org/Function_Reference/_e>


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

php _e question pigsfoot.trotter@gmail.com - 2015-01-10 10:09 -0800
  Re: php _e question "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-01-10 19:41 +0100
    Re: php _e question pigsfoot.trotter@gmail.com - 2015-01-10 11:18 -0800
      Re: php _e question Tim Streater <timstreater@greenbee.net> - 2015-01-10 19:43 +0000
      Re: php _e question Jerry Stuckle <jstucklex@attglobal.net> - 2015-01-10 23:02 -0500
  Re: php _e question Richard Damon <Richard@Damon-Family.org> - 2015-01-10 15:32 -0500
  Re: php _e question pigsfoot.trotter@gmail.com - 2015-01-10 15:02 -0800
  Re: php _e question Denis McMahon <denismfmcmahon@gmail.com> - 2015-01-11 17:17 +0000
  Re: php _e question Arno Welzel <usenet@arnowelzel.de> - 2015-02-04 05:22 +0100

csiph-web