### Example: Get Current User's Email Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-current-user-user-meta Demonstrates how to use the shortcode to retrieve the current user's email address. This example shows the shortcode usage and how it might be integrated into a dynamic text form tag. ```shortcode CF7_get_current_user key='user_email' ``` ```shortcode [dynamictext inputname "CF7_get_post_var key='post_title'"] ``` -------------------------------- ### Example Theme Option Retrieval (Shortcode) Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-theme-option An example showcasing how to retrieve a specific theme setting, 'legal_business_name', using the `CF7_get_theme_option` shortcode. ```html CF7_get_theme_option key='legal_business_name' ``` -------------------------------- ### Example Post IDs (PHP) Source: https://aurisecreative.com/docs/accessible-reading/frequently-asked-questions This snippet shows an example of how post IDs might be represented in PHP. It indicates an empty string for a specific ID field, suggesting a potential default or unassigned state. ```php string(0) "" ``` -------------------------------- ### Post IDs Example Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-date An example demonstrating the format for 'Post IDs' as a string, which appears to be an empty string in this context. This might be relevant for associating form data with specific posts. ```php string(0) "" ``` -------------------------------- ### PHP Post IDs Example Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tag-attribute-after-page-load Demonstrates a PHP data structure representing post IDs, which might be used in backend logic or for referencing content. ```php $post_ids = "string(0) \"\"; ``` -------------------------------- ### Related by Terms Example Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-date An example showing an array of integers representing 'Related by Terms'. This format is typically used to link content or apply specific filtering based on term IDs in WordPress. ```php array(2) { [0]=> int(12046) [1]=> int(22678) } ``` -------------------------------- ### PHP Related Terms Example Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tag-attribute-after-page-load Shows a PHP array containing integer values, likely representing terms or IDs related to specific content. ```php $related_terms = array( 0 => int(12046), 1 => int(22678) ); ``` -------------------------------- ### DTX Shortcode: GUID Cache Compatibility Mode Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-guid Explains how to enable cache compatibility for the CF7_guid shortcode. This ensures the GUID is generated via JavaScript on the client-side, even if the page HTML is cached, by utilizing the browser's Crypto API. ```javascript // Example of client-side GUID generation using Crypto API (conceptual) if (window.crypto && window.crypto.randomUUID) { const guid = window.crypto.randomUUID(); } else { // Fallback for older browsers if necessary function generateFallbackGuid() { // Implementation for generating a GUID without Crypto API return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } const guid = generateFallbackGuid(); } ``` -------------------------------- ### DTX Shortcode: GUID Source Code Reference Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-guid Provides direct links to view the server-side shortcode and client-side JavaScript function source code for the CF7_guid shortcode. This is useful for developers wanting to inspect or understand the implementation details. ```php // Link to server-side shortcode source code (Conceptual link, actual link would be in documentation) // Example: https://github.com/example/contact-form-7-dynamic-text-extension/blob/main/includes/shortcodes/class-cf7-dtx-shortcode-guid.php ``` ```javascript // Link to client-side JavaScript function source code (Conceptual link, actual link would be in documentation) // Example: https://github.com/example/contact-form-7-dynamic-text-extension/blob/main/assets/js/cf7-dtx-guid.js ``` -------------------------------- ### DTX Shortcode: Example with Yoast SEO Meta Description Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-post-meta-custom-fields An example demonstrating how to use the CF7_get_custom_field shortcode to populate a form field with the meta description defined in the Yoast SEO plugin. The dynamic text form tag uses the retrieved meta value. ```shortcode CF7_get_custom_field key='_yoast_wpseo_metadesc' ``` ```shortcode [dynamic_text inputname "CF7_get_custom_field key='_yoast_wpseo_metadesc'"] ``` -------------------------------- ### Static Placeholder Example in Contact Form 7 Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension Illustrates setting a static placeholder text for a text input field in Contact Form 7. ```php [text cf7-text-placeholder placeholder "Hello World"] ``` -------------------------------- ### Dynamically Populate Form Field using GET Variable Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-php-get-variables This example demonstrates how to use the `CF7_GET` shortcode within a Contact Form 7 dynamic text field to pull a value from a URL query parameter. The form tag directly embeds the shortcode to insert the dynamic content. ```html [dynamictext inputname "CF7_GET key='foo'"] ``` -------------------------------- ### Static Select Options Example in Contact Form 7 Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension A standard Contact Form 7 shortcode to create a select dropdown with static options and a blank placeholder. ```php [select static-select include_blank "Apples" "Bananas" "Dragonfruit"] ``` -------------------------------- ### Static Default Value Example in Contact Form 7 Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension A basic example of setting a static default value for a text input field in Contact Form 7, without using the DTX plugin. ```php [text cf7-text-value "Hello World"] ``` -------------------------------- ### PHP Example: Post IDs Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/dynamic-attributes This snippet shows a PHP representation of post IDs, likely used in conjunction with WordPress or a similar CMS. It indicates an empty string for a string type and an array of integers for an array type. ```php string(0) "" array(2) { [0]=> int(12046) [1]=> int(22678) } ``` -------------------------------- ### PHP Shortcode: Get WordPress Product Options Source: https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select A custom WordPress shortcode function that retrieves product data from the website, formatted as HTML options for a select field. It queries products in the 'WordPress Plugin' category. ```php /** * Get WordPress Product Options for DTX Select Field * * @return string HTML output of product options for use inside a