我想知道执行以下操作的最优雅/最佳实践方式:
假设我有一些 PHP 会返回一个字符串(例如今天的天气)。我希望能够在 WordPress 页面中包含字符串,但不是通过使用插件来允许在页面中使用 PHP。
例如:
This is content of the page that is editable via WordPress pages.
Today's weather is THE_WEATHER. This bit is also editable, but as
an editor I can't edit the PHP that just told us what the weather
is, the developer does that.
执行此操作的最佳实践方法是什么(最好不使用插件)?