$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Disable -2 Permalink Addition|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Disable -2 Permalink Addition

matteradmin9PV0评论

I am aware that WordPress forbids slugs for pages ending in numerics alone and automatically appends '-2' when they occur. However, other permalink work arounds will not do in my case and I would prefer WordPress simply 'lose' this rule so that numeric slugs will be allowed, and the '-2' will be added only in the case of true file conflicts, i.e. having an image and page both named the same number.

How do you disable WordPress from automatically rejecting numeric slugs except in the case of true conflicts?

EDIT. Since it was asked. I have folders of organized events, with the years they occurred.

So my pages will look like Event1/2019/...., but of course when I try to use a page 2019, it wants the '-2' so that the url will instead be Event1/2019-2/.... I would like to eliminate the '-2' of the 2019. There are no images or other files labeled 2019, this is not a file conflict but rather WordPress allowing pure numerics only to appear on post permalinks and not page permalinks.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far