How to display a "slug" column in page-list?

Support MB Admin Columns How to display a "slug" column in page-list?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42891
    s.liem@me.com[email protected]
    Participant

    Hey there,

    on my pages-dashboard, I'd like to add a column where the slug of each page will be displayed.

    I have tried to find a solution in the docs, but didn't find any.

    Can you pls help me with this?

    Thank you in advance and kind regards,
    Sascha

    #42897
    PeterPeter
    Moderator

    Hello,

    You can try to create a text field and enable an admin column for this field. After creating/updating the post, you can use the action hook save_post to update the post slug for the field and get the post slug via $_POST['post_name'].
    Read more about action hook in the documentation https://developer.wordpress.org/reference/hooks/save_post/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.