{"id":304,"date":"2025-03-13T10:31:09","date_gmt":"2025-03-13T10:31:09","guid":{"rendered":"https:\/\/documentation.iqonic.design\/graphina\/?p=304"},"modified":"2025-03-13T10:31:11","modified_gmt":"2025-03-13T10:31:11","slug":"unlocking-the-power-of-dynamic-keys-in-wordpress","status":"publish","type":"post","link":"https:\/\/documentation.iqonic.design\/graphina\/unlocking-the-power-of-dynamic-keys-in-wordpress\/","title":{"rendered":"Unlocking the Power of Dynamic Keys in WordPress"},"content":{"rendered":"<div class=\"nolwrap\">\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p>Dynamic Keys are a powerful feature that allows users to configure and modify variables dynamically within MySQL queries and APIs. With this capability, users can create interactive tables and charts that adapt based on shortcodes, displaying different data on various pages.<\/p>\n\n\n\n<p>To use this feature, simply enable the <strong>Dynamic Key<\/strong> option from the Elementor editor. Once activated, you can personalize content effortlessly, ensuring your charts and tables reflect real-time, user-specific data.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Important Note:<\/strong><\/h4>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"263\" height=\"92\" src=\"https:\/\/documentation.iqonic.design\/graphina\/wp-content\/uploads\/sites\/3\/2025\/03\/image.png\" alt=\"\" class=\"wp-image-305\" style=\"width:377px;height:auto\" \/><\/figure>\n<\/div>\n\n\n<p>Ensure the <strong>Dynamic Key<\/strong> option is enabled in the Elementor editor before using these keys.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>List of Available Dynamic Keys<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>{{CURRENT_USER_ID}}<\/code><\/strong> \u2013 Retrieves the ID of the currently logged-in user (returns <code>0<\/code> if the user is logged out).<\/li>\n\n\n\n<li><strong><code>{{CURRENT_USER_EMAIL}}<\/code><\/strong> \u2013 Displays the logged-in user&#8217;s email. If the user is not logged in, the default email will be <code>demographina@gmail.com<\/code>.<\/li>\n\n\n\n<li><strong><code>{{CURRENT_USER_ROLE}}<\/code><\/strong> \u2013 Reflects the role of the currently logged-in user. If no user is logged in, the default role will be <code>demoadmin<\/code>.<\/li>\n\n\n\n<li><strong><code>{{CURRENT_DATE}}<\/code><\/strong> \u2013 Replaces the key with the current WordPress date (Format: <code>Y-m-d<\/code>).<\/li>\n\n\n\n<li><strong><code>{{CURRENT_DATE_TIME}}<\/code><\/strong> \u2013 Displays the current WordPress date and time (Format: <code>Y-m-d H:i:s<\/code>).<\/li>\n\n\n\n<li><strong><code>{{CURRENT_TIME}}<\/code><\/strong> \u2013 Shows the current WordPress time (Format: <code>H:i:s<\/code>).<\/li>\n\n\n\n<li><strong><code>{{QUERY_PARAM_\u2019query parameter key\u2019}}<\/code><\/strong> \u2013 Fetches the value of a query string parameter from the page URL. If the parameter is missing, the key remains unchanged.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Example Usage:<\/strong><\/h4>\n\n\n\n<p>If your page URL contains a query string like:<br><code>http:\/\/localhost\/graphina\/?user_id=1<\/code><br>Using <code>{{QUERY_PARAM_user_id}}<\/code> will retrieve the value <code>1<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Limitations to Keep in Mind:<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Dynamic Keys do <strong>not<\/strong> function in Elementor <strong>editor mode<\/strong> or <strong>preview mode<\/strong>.<\/li>\n\n\n\n<li>They will not work if the page is accessed through an <strong>iframe<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>By leveraging <strong>Dynamic Keys<\/strong>, you can enhance user experiences by displaying personalized, real-time content with minimal effort.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to use dynamic Key in sql builder or api.   | Iqonic Design\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/sOAn6FQ8YLY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Dynamic Keys are a powerful feature that allows users to configure and modify variables dynamically within MySQL queries and APIs. With this capability, users can create interactive tables and charts that adapt based on shortcodes, displaying different data on various pages. To use this feature, simply enable the Dynamic Key option from the Elementor editor. [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"parent":235,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-304","post","type-post","status-publish","format-standard","hentry","category-graphina"],"featured_image_src":null,"author_info":{"display_name":"wordpressadminiq","author_link":"https:\/\/documentation.iqonic.design\/graphina\/author\/wordpressadminiq\/"},"children":[],"_links":{"self":[{"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/posts\/304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/comments?post=304"}],"version-history":[{"count":1,"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/posts\/304\/revisions"}],"predecessor-version":[{"id":307,"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/posts\/304\/revisions\/307"}],"up":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/posts\/235"}],"wp:attachment":[{"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/media?parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/categories?post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/graphina\/wp-json\/wp\/v2\/tags?post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}