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?
- Rewrite rules for custom post type
- Custom taxonomy and post type rewrite rules
- custom posts permalinks url rewriting
- Use a different URL path / permalink for CPT
- Url Rewriting a dynamic wordpress page with parameters
- Adding /blog in front of single posts (only)
- Custom taxonomy terms as children of multiple custom post types
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- multiple URLS for the same page
- 404 error rewrite permalinks
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- How to apply multiple rewrite_rule to a single custom post type url?
- How to properly set the rewrite rules for this case?
- Category permalinks don’t work even after flushing
- CPTs relationship
- Change CPT permalink to use the category
- add_rewrite_rule wordpress ignoring url pattern, wp rewrite not working
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- Redirect Custom Post Type from Child Taxonomies
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Rewrite url for custom post type with specific url
- Customise Permalink Structure For Custom Post Types
- How to make “single post” permalink maintain it’s sub-page structure
- Rewrite URL of Specific Post of Custom Type
- CPT – Custom Text fields point to new url permalinks
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Custom post type rewrite and wp_pagenavi interfering with each other
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Permalinks for a custom post type – with a page template (custom query) and taxonomy archive
- how to use two permalinks for one custom post type based on categories
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- page not found for example.com/custom-post-name
- Paging not working for hierarchical custom post type
- Custom post type with parent page? Possible?
- redirect old post type url to new structure url
- Remove sequential number from permalinks
- Multiple Custom Post Type permalink issue
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- Archive page for a custom post type using WPML
- Why won’t this rewrite rule work?
- Customizing the custom post type permalink
- Custom post type child page 404
- Permalink clashing with Custom Post Type rewrite rule
- URL Rewrite Adjustment for Custom Post Type causes template to revert to index.php
- How to make nested custom post type slugs work
- Rewrite Rule & Regex – Extract ‘cat-name’ and ‘page-number’ from http://domain.com/custom-post-type/category/cat-name/page/page-number
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- What is the proper way implement a global $wp_rewrite?
- rewrite rules add a folder in the path
- Custom Post Type – Rewrite slug [duplicate]
- Custom post type and custom taxonomy archive inaccessible
- How can you preserve URLs when moving posts to a custom post type?
- Custom Taxonomy in Permalink from post type
- 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
- How to add custom permalink struct with DYNAMIC author to a Custom Post Type
- Custom archive URL as a subfolder of the custom post type slug
- Custom post type Premalinks main page and details page
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)