automattic / allow-numeric-stubs Goto Github PK
View Code? Open in Web Editor NEWWordPress plugin that allows pages to have a numeric slug (URL).
Home Page: https://alex.blog/wordpress-plugins/allow-numeric-stubs/
WordPress plugin that allows pages to have a numeric slug (URL).
Home Page: https://alex.blog/wordpress-plugins/allow-numeric-stubs/
I modified the plugin code to work with CPTs. You can view my forked repository here: https://github.com/akshatkedia/allow-numeric-stubs
WordPress is now allowing numeric slugs for CPTs but when I visit a child post with a numeric slug it redirects to the parent post automatically. So for example I have a Programmes CPT. There is a parent program with the slug: programmes/city-in-visible/ and a child program with the slug: programmes/city-in-visible/2009/
Visiting programmes/city-in-visible/2009/ redirects to programmes/city-in-visible/
Can you please suggest a solution for this?
An all-numeric URL may come from part numbers, serial numbers, etc, and probably rely on search engines to index the unmodified numerical slug.
A status response of 301 creates a situation where search engines may update their index to the redirected URL /######-2/ whereas a 302 redirect will not initiate this update. And more specifically 302 has been superceded by 303 and 307 responses, with 307 likely the appropriate one.
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection
I see that you're hooking into wp_unique_post_slug and am not sure you can control the redirect status from where you're doing this modification, so changing to 307 might not be an option. Thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.