Hot answers tagged

2

"best" greatly depends on context. guid is probably (with some debate about it) the best way to uniquely identify a post, but not all import/export plugins leave it alone without changes. ID is a good identifier if you do not care about import and export. Slug is problematic because they might be changed by the user. The best thing to do if you need to ...


1

Actually you should skip the condition altogether - you don't need to worry about permissions or context here, you are merely saying: If WordPress, for whatever reason, is determining if a slug is bad: run my additional conditions Currently, if a theme/front-end plugin/REST API call was triggering the filter (i.e. insert/updating a post), your checks ...



Only top voted, non community-wiki answers of a minimum length are eligible