Title and post URL based on custom fields?

I think a good way to do what you want is hook the wp_insert_post_data filter. Here you can change the title and slug of the post before it is saved to database: add_filter( ‘wp_insert_post_data’, ‘wpse_update_post_title_and_slug’ ); function wpse_update_post_title_and_slug( $data ) { //You can make some checks here before modify the post data. //For example, limit … Read more

Custom post types and permalinks

I’m not really sure whats going on here – havent done too much with rewrites like this. But should this: $newRules[‘content/(.+)/(.+)/?$’] = ‘index.php?content=$matches[2]’; $newRules[‘content/(.+)/?$’] = ‘index.php?campus=$matches[1]’; Be This?: $newRules[‘content/(.+)/(.+)/(.+)/?$’] = ‘index.php?content=$matches[3]’; $newRules[‘content/(.+)/(.+)/?$’] = ‘index.php?campus=$matches[2]’; To Match: /content/peoria/new-visitor/children/ /content/peoria/connect/next-generation/children/ ?

Custom post types, taxonomies, and permalinks

Change slug in your post type arguments to products/%product_cat%, and slug in your taxonomy arguments to just products, then flush your rewrite rules. WordPress should now handle /products/my-product-cat/post-name/! Now finally, we need to help WordPress a little with generating permalinks (out of the box, it won’t recognise the permastruct tag %product_cat%): /** * Inject term … Read more