• bluebard

    (@bluebard)


    Hello.

    I’ve been doing a new site and when I do things with WP, I like to do a lot of the PHP programming for more precise control over things.

    Anyway, for the people editing the page, I want to put a box or something where they can edit the page’s slug after creation.

    Example URL 1: https://www.mysite.com/reports/view/reportslug1/
    Example URL 2: https://www.mysite.com/news/view/newsslug2/

    *Note: I also use custom post types.

    It actually CAN be edited on the list of posts with the Quick Edit, but not on the main edit page for some reason. If I turn on permalinks, a slug editor actually will appear on the edit page, but I don’t want to do that because Peramlinks also seem to interfere with certain post types.

    I prefer writing my own htaccess and using the page’s slug to view the page. If the slug is undefined, then a 404 will simply appear.

    One thing that’d really be cool is if there could be both a default view and a “pretty” view.

    Default Example: https://www.mysite.com/?report=reportslug1
    Pretty Example: https://www.mysite.com/report/view/reportslug1/ (Edit Slug button)

    Is there a simple plugin to add a slug editor to the main edit page regardless of the status of Permalinks? Is such a thing difficult to add?

    Thanks in advance.

    • This topic was modified 5 years ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • Joy

    (@joyously)

    You would be better off using the whole of WordPress instead of coding around it.
    As you said, it already handles editing slugs, in both editors. If permalinks aren’t used, all of the functions that deal with internal links generate the links without slugs. But if they are on, it all works well with no extra code needed.
    The problem you have with certain post types is most likely because of defining the post type rewrite in a strange way. Maybe you should get that worked out and just use what WordPress already does with Permalinks on.

    Thread Starter bluebard

    (@bluebard)

    Hello. Sorry for the super late reply, but yeah. I looked into how things worked a little more closely and I understand it better now.

    My main mistake was thinking that htaccess does the rewrites when WP itself does them in the main program.

    I got it now. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding slug editor to edit page without permalinks’ is closed to new replies.