[wp-hackers] Please help diagnose custom post type permalinkproblem

David F. Carr david at carrcommunications.com
Sun Dec 12 17:16:20 UTC 2010


Philip, thanks for giving me some other things to check.

The taxonomy code I'm using (adapted from an example in the codex) is below.
Don't think it's the source of the problem, which was originally reported on
an earlier release that didn't have a taxonomy added.

  // Add new taxonomy, make it hierarchical (like categories)
  $labels = array(
    'name' => _x( 'Event Types', 'taxonomy general name' ),
    'singular_name' => _x( 'Event Type', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search Event Types' ),
    'all_items' => __( 'All Event Types' ),
    'parent_item' => __( 'Parent Event Type' ),
    'parent_item_colon' => __( 'Parent Event Type:' ),
    'edit_item' => __( 'Edit Event Type' ),
    'update_item' => __( 'Update Event Type' ),
    'add_new_item' => __( 'Add New Event Type' ),
    'new_item_name' => __( 'New Event Type' ),
    'menu_name' => __( 'Event Type' ),
  );

  register_taxonomy('rsvpmaker-type',array('rsvpmaker'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'rsvpmaker-type' ),
  ));


On Sun, Dec 12, 2010 at 11:27 AM, Philip M. Hofer (Frumph) <
philip at frumph.net> wrote:

> Are you using register_taxonomy() on the "rsvpmaker-type" ? I noticed you
> using taxonomy => in the register for the post type instead of
> register_taxonomy_for_object_type();
>
> You're also using 'rewrite' => true  - instead of 'rewrite' => array(
> 'slug' => 'rsvpmaker' ) which is fine; of course I would do: 'rewrite' =>
> array( 'slug' => 'comic', 'with_front' => true ),  to make sure that just in
> case if someone is using subdir installation of wpms can attach /blog/ at
> the front .. (as far as I understand how that works)
>
> I've done a lot of work with custom post types recently and only
> encountered something like that if I wrote something out of place when it
> was trying to create the rewrite rules .. or some other plugin was
> interferring.
>
> There are a few themes and plugins that check all post types instead of
> just the one they're working with.
>
> for example they're doing this:
>
> $args = array(
>  'public' => true,
>  '_builtin' => false
>  );
> $output = 'names';
> $operator = 'and';
>
> $post_types = get_post_types( $args , $output , $operator );
>
>
> which basically gets all custom post types then working with them, so what
> is happening is its creating a different set of rewrite rules then the ones
> intended (if they work with it afterwards), ... so could you look at what
> else is running on her setup and see if it could be conflicting?
>
> - Phil
>
>


More information about the wp-hackers mailing list