Adding php within a return statement [closed]
You can just call PHP functions directly. In this case however we possibly don’t want to call the_permalink() since it echoes out the link: function the_permalink( $post = 0 ) { /* … */ echo esc_url( apply_filters( ‘the_permalink’, get_permalink( $post ), $post ) ); } whereas we want to return the link in a string. … Read more