Docly Child

Dynamic Keys

Estimated reading: 2 minutes

The Dynamic key is an essential feature that empowers users to configure or modify dynamic variables used in MySQL queries and APIs. It enables the creation of tables and charts that can be adjusted with shortcodes to display different data on various pages. To utilize this feature, users need to enable the dynamic key option from the Elementor editor. With this functionality, users can easily create customized tables and charts, ensuring they present data in the most effective manner.

Imp Note : Please enable dynamic key options from elementor editor to use dynamic keys

  • {{CURRENT_USER_ID}} – This key will be always replaced with the ID of the currently logged-in user (0 for logged-out users).
  • {{CURRENT_USER_EMAIL}} – This key will replace email id with currently logged in user. If user is not logged in then by default email id will be ‘demographina@gmail.com‘.
  • {{CURRENT_USER_ROLE}} – This key will change user’s role with currently logged in user’s first role. If user is not logged in then by default role will be ‘demoadmin’.
  • {{CURRENT_DATE}} – This key will change the date with wordpress current date. Eg:- current_time(‘Y-m-d’).
  • {{CURRENT_DATE_TIME}} – This key will change the date and time with wordpress current date and time. Eg:- current_time(‘Y-m-d H:i:s’).
  • {{CURRENT_TIME}} – This key will change the time with wordpress current time. Eg:- current_time(‘H:i:s’).
  • {{QUERY_PARAM_’query parameter key’}} – The {{QUERY_PARAM_’query parameter key’}} is a key that can be used to fetch the query string of a page’s URL. If the query string is present, this key will replace the key with the value of the query string. However, if the query string is not found, the key will not be replaced.
    For example, if the query string is user_id ($_GET[‘user_id’]) in http://localhost/graphina/?user_id=1, the key {{QUERY_PARAM_user_id}} can be used to fetch the value of user_id.
    It is important to note that this feature will not work in Elementor editor mode, Elementor preview mode, or if the page is called by an iframe.

For user based data:

Leave a Comment

Share this Doc
CONTENTS