WebDevStudios / StartBox

An incredibly powerful theme framework for WordPress. Download here: http://wpstartbox.com/startbox.zip. Get our sample child theme here: http://github.com/webdevstudios/StartBox-Child —
http://wpstartbox.com
GNU General Public License v2.0
170 stars 41 forks source link

Custom sidebars don't check for sidebar post type before applying default slug, and also could end up with the same default slug on multiple posts. #57

Closed Pypeline closed 11 years ago

Pypeline commented 11 years ago

I was going to put in a pull request for it but my current one is still open. This checks for the sidebar post type (I've had other CPT of mine end up with 'custom-sidebar' as their slug) and also adds the ID onto the end of the "custom-sidebar" default slug.

at line 70 in /includes/extensions/sidebars.php

// Make sure this isn't an unsaved post (auto-draft) and is a custon sidebar post if ( 'auto-draft' != $postarr['post_status'] && 'sidebar' == $data['post_type'] && '' == $data['post_name'] ) { $data['post_name'] = 'custom-sidebar-'.$postarr['ID']; }

Pypeline commented 11 years ago

let me just add this example so you can see how bad it can get. check out this RSS feed and do a Find for "custom-sidebar" http://blogs.kidshopeusa.org/?feed=rss

Poor blog has all kinds of permalinks with "custom-sidebar" in it. Please address soon.

jtsternberg commented 11 years ago

This issue has been addressed in the 2.7.2 branch (f1e5e68f91b288135ce714ca734439e1e377e032) and should be merged to trunk in the next week. cc: @brichards

Pypeline commented 11 years ago

Ah, true that, thanks for pointing it out. It does not address the issue of creating multiple sidebars with the same slug of "custom-sidebar" though as my snippet above does.

brichards commented 11 years ago

Thanks for the heads up @Pypeline!