Concatenating ECHO syntax in PHP

后端 未结 5 1118
南笙
南笙 2020-12-30 06:35

I have made a small function (WordPress), using echo .

/* .. Some code */
switch ($linktype) {
    case \"next\":
        echo \'

5条回答
  •  有刺的猬
    2020-12-30 07:20

    The issue is that the WordPress previous_post_link('%link',''.$prevthumbnail.'') function actually has its own print command built-in, and it prints after the echo finishes its printing.

    If you want to use this command within an echo (or to save to a string) you must use get_previous_posts_link, which instead of printing the value returns it.

提交回复
热议问题