php - nested escaping regarding _e() function
Get the solution ↓↓↓first question ever here on stackoverflow: i want to escape html inside php AND then inside html php again AND return a string from an _e() function. i am not sure if the "lingo" is correct. so here is the case:
return '...<span class="strike"></span><a class="read-more" href="'.
get_permalink($post->ID) . '" title="'.get_the_title($post->ID).'">Read more</a>';
the "read more" should be replaced with
_e( 'Read more', 'mytheme' )
to be able to translate the term.
I tried everything. All help appreciated.
Answer
Solution:
How about:
return '...<span class="strike"></span><a class="read-more" href="'.
get_permalink($post->ID) . '" title="'.get_the_title($post->ID).'">'._e( 'Read more', 'mytheme' ).'</a>';
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: target class [commandmakecommand] does not exist.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.