rewrite tag - Where to add add_rewrite_tag for trailing tilde?

Ive just been reading @gmazzap s reply about wordpress matching URLs with trailing tildes.and could do with some help p

Ive just been reading @gmazzap s reply about wordpress matching URLs with trailing tildes.

and could do with some help please. As a coding newbie, I am not sure where to add his suggested code:

add_action('init', function() {
  add_rewrite_tag( '%postname%', '([^~/]+)', 'name=' );
});

Functions.php, /includes/rewrite.php, or somewhere else...

Also what are the implications of doing this, when wordpress updates, will these changes be lost? Am running a child theme. Sorry to ask such basic questions. Thanks for your help.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742295310a4416998.html

相关推荐

  • rewrite tag - Where to add add_rewrite_tag for trailing tilde?

    Ive just been reading @gmazzap s reply about wordpress matching URLs with trailing tildes.and could do with some help p

    18小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信