| 3 | | As a workaround for your problem, you can reset {{{$wp_query->queried_object}}} to {{{get_post_type_object( get_post_type() );}}} so that post_type_archive_title() gets the correct thing when it calls get_queried_object(). |
| | 3 | As a workaround for your problem, you can reset {{{$wp_query->queried_object}}} to whatever you need, without modifying Core: |
| | 4 | |
| | 5 | {{{ |
| | 6 | function change_queried_object() { |
| | 7 | global $wp_query; |
| | 8 | |
| | 9 | if ( is_post_type_archive() ) |
| | 10 | $wp_query->queried_object = get_post_type_object( get_post_type() ); |
| | 11 | } |
| | 12 | add_action( 'template_redirect', 'change_queried_object' ); |
| | 13 | }}} |