Not sure the rewrite rule is good, but to answer the question about getting the post meta – you already have the post Object, so you don’t need to run a function to get the global $post, which might also fail or be wrong – you can simply use:
$metaText = get_post_meta( $post->ID, 'test_text_field', true);
You will probably also want to debug the value of $metaText to ensure it returns something.
Related Posts:
- Adding meta values to permalink
- Custom rewrite rules for archive page and single post
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Multiple post types – share same ReWrite slug?
- How to modify URL structures in custom post types and taxonomies or terms
- Permalinks so that one custom post type appears to be a child of another, not working
- Permalink rewrite with custom post type and custom taxonomy
- Prepend meta_value to permalink of post
- Rewrite custom post type url’s adding meta box values
- Permalinks for CPT breaks permalinks to pages
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- WordPress Rewrite rule for nested post types
- Custom Permalink Tag breaks Pagination
- Custom Permalink for Taxonimie and Custom Post Type
- Permalink Structure CPT With Custom Taxonomy Fails
- Making a custom help center page
- How to change custom post type permalink structure
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- Customize Custom Post Type URL
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Pretty URLs and custom post types
- Combine multiple CPT names to create valid permalinks
- Set parent for custom post type archive rewrite url
- Route subpage to Custom Post Type
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- WordPress custom permalink and archive link for custom post type
- Rewrite URL for CPT to domain/post-name/post-id
- Custom permalink structure for custom post types including multiple taxonomy
- Two CPT: one is using part of the custom rewrite slug from the other
- WordPress custom post type rewrite rule matches all pages returning 404
- Parent cpt/child custom post type URL permalink relationship
- Custom post type permalink structure
- What is the best way to relate different custom post types?
- Can a custom post type have a Parent Page?
- Rewriting a custom-post-type permalink with taxonomy term?
- Custom Post Type Permalink / Rewrite not working immediately
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- Using /%postname% for a custom post type
- Changing the URL Structure of a Paginated Custom Post
- Custom Posttype Inheritance (and url structure)
- Create permalink structure for one taxonomy archive per custom post type
- How to achieve this permalink -> category-name/custom-post-type-name/post-name
- Custom permalinks
- Custom post type permalink changing itself every other change
- Custom post type’s get_permalink returns wrong url
- ACF Relationships in Custom Post Type Permalink
- How to check if last uri segment is a custom post type or taxonomy term?
- Custom Permalinks for Custom Post Types and Taxonomies
- Removing parent slug from URL on custom post type
- Multiple parameters in a custom post type url rewrite
- URL rewrite and navigation structure for wordpress custom post type
- Custom post type category, taxonomy and URL rewrite problem
- how to use two permalinks for one custom post type
- Rewrite on custom post type permalink not working?
- how to get archive urls with same origin for custom types and terms?
- Permalinks for Taxonomy and Custom Post Type
- Share parent path between Custom Post Types and Pages?
- multiple url slug for single custom post type
- Custom Post Type and Custom Taxonomy Permalinks
- Pagination problem
- Change Permalink Structure for Tag.php template
- Add archive slug to default post post type
- Custom Post type and permalink settings
- Custom rewrite rule for hierarchical custom post type
- Rewrite and custom post type: order by custom field not working
- Rewrite rules for custom posts types
- Adding custom post category slug in permalink causes 404 error for pages and posts
- WordPress custom post type permalink rewrite shows page not found
- Custom taxonomy rewrite with query var returns %2F in URL
- cpt and page sharing same base permalink
- Hide or disallow default custom post type url?
- Custom taxonomy returns 404
- Flush Rewrite Rules when new site is created on network
- Specific routing for CPT
- Lost of query parameter when using permalink
- Custom Rewrite Rule for Custom Post Type with URL Param
- WordPress custom slug rewrite
- Dynamic CPT permalink structure based on ACF field value
- Post type Permalink
- Add Custom Values to Permalinks Through Custom Fields and Posts
- Rewrite rules for custom post type
- Custom taxonomy and post type rewrite rules
- custom posts permalinks url rewriting
- Url Rewriting a dynamic wordpress page with parameters
- Custom taxonomy terms as children of multiple custom post types
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Change CPT permalink to use the category
- add_rewrite_rule wordpress ignoring url pattern, wp rewrite not working
- CPT – Custom Text fields point to new url permalinks
- redirect old post type url to new structure url
- Custom post type child page 404
- URL Rewrite Adjustment for Custom Post Type causes template to revert to index.php
- Custom Post Type – Rewrite slug [duplicate]
- Rewrite rules for using the same base slug for multiple content types
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- add_rewrite_rule not working in Custom Post Type UI Plugin
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)