• I would recommend refactoring the plugin to use the post slug $post->post_name rather than picking apart the permalink structure. This method would also work on installs that do not use “pretty permalinks”.

    You should also consider sanitizing the added classes with sanitize_html_class().

    I also think it would be a good idea to prefix the value with the posttype for example to prevent un-intended results.
    ( ie: {$posttype}_{$post->post_name} )
    This kind of change would break selectors for people using the current implementation though so an option would be needed for backwards compat.

    For example: A post/page with title “Hide” on a site using the popular twitter bootstrap framework would render the entire site invisible.

    Cheers 😉

    http://wordpress.org/plugins/add-url-slugs-as-body-classes/

Viewing 1 replies (of 1 total)
  • Plugin Author Aaron T. Grogg

    (@aarontgrogg)

    gotcha. yes, it is not going to be perfect for all situations, but then nothing likely will be… 🙂

    good suggestions, though, will take them into consideration if i ever do any refactoring on this.

Viewing 1 replies (of 1 total)
  • The topic ‘Recommendations’ is closed to new replies.