Echo
внутри вашего метода, здесь работать не будет, так как вы объединяете, вы можете сохранить свой результат в массиве и затем использовать return
LIKE:
function showAllEmoje() {
$dirname = get_bloginfo('template_url').'/Image/emoji/';
$images = glob($dirname."*.gif");
$imagesArr = array(); // initialize an array
foreach($images as $image) {
// store in an array
$imagesArr[] = '<img src="'.$image.'" onclick="add_emojiCode_to_coment_textAria(\'[:'.$image.':]\');" >';
}
return $imagesArr;
};
Затем вызовите ваш методи сохранить его в переменной.
$functionResult = showAllEmoje(); // method calling
Затем вы можете использовать конкатенацию LIKE:
$yourHTML = '<div class="comment-form-comment">
<div class="comment-form-emoji-icon">
<img src="'.get_bloginfo('template_url').'/Image/emoji.png" onclick="invertShowEmojiList()">
<div class="comment-form-emoji-list" id="ID_EmojiList">';
$yourHTML .= implode("<br/>",$functionResult); // using implode() to print
$yourHTML .= '</div>
</div>
<textarea id="comment" name="comment" cols="45" rows="4" required placeholder="دیدگاه شما..." ></textarea>
</div>';
$args = array(
'comment_field' => $yourHTML
);
comment_form( $args );