[Plugin: WP Easy Post Types] Multisite Permalinks
I am running WP Multisite and using SiteWide Tags 0.4.1 to pull all posts on to the main domain of the site from the other blogs within the domain.
I am having an issue with the permalinks of a custom post type on the main blog, and I believe this issue is slightly different from the other issues described in this forum.
With normal posts, the main domain sets the permalink of each post to the corresponding blog that it came from. No issues there and it has worked like this for quite some time.
I have now tried to replicate the same thing with custom post types using the Easy Post Types plugin. After a bit of modification to the SiteWide Tags plugin, I was able to get the custom posts to be duplicated on the main site as well.
However, the custom posts on the main site seem to set the permalink to the main blog and not to the originating blog. I can’t seem to understand why.
I am not sure if the bug is in Easy Post Types plugin, Sitewide plugin or the wordpress code itself.
After a bit of hacking, the following code within the link-template.php class seems to be the issue, but I am not sure how to fix it:
elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) return get_post_permalink($post, $leavename, $sample);
or it could be the code within the get_post_permalink method. I am not sure. If I make this a negative statement (in essence, saying that the custom post type is not within that array) it creates the correct permalink to the originating blog (but of course, messes up the permalink of normal builtin posts). I could try and hack this further, but wanted to make sure I haven’t missed a trick somewhere.
The database has the correct permalink set in post meta table. So, I am ruling out an issue with the sitewide plugin which does the copy of the posts to the main blog. The wordpress code seems to be ignoring this setting anyways as far as I can see within the code.
Anyone have a clue?
- The topic ‘[Plugin: WP Easy Post Types] Multisite Permalinks’ is closed to new replies.