aw2.get
/ Core / aw2.get
Get a variable
Parameters supported: default
It returns: Return a variable
Syntax:
[aw2.get “variable_name” /]
Example:
1 |
[aw2.get template.lname /] , here template.lname is a variable which is already set. |
To get the attachment URL (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get attachment_url attachment_id='{template.data.image}' /] |
To get the menu position (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 2 3 4 5 6 |
[aw2.get menu] { "theme_location": "primary_navigation", "echo":false } [/aw2.get] |
To get the Alternate text set for media (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 2 3 |
[aw2.get image_alt attachment_id='1126445' /] [aw2.get image_alt post_id='1181341' /] |
To get the details of an attachment (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get attachment attachment_id='1126445' o.dump=true /] |
To get breadcrumbs in the single post page (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 2 3 |
[aw2.get breadcrumb seperator='--' show_home='yes' /] [aw2.get breadcrumb show_home='no' /] |
To get the next post, the previous post of a given post (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 2 3 4 5 6 7 8 9 10 11 |
[aw2.get next_post post_id='1045833' /] //returns post id of next post [aw2.get next_post.url post_id='1045833' in_same_cat='true' /] [aw2.get next_post.slug post_id='1045833' in_same_cat='true' take_all_post='yes'] [aw2.get prev_post post_id='1045833' /] //returns post id of previous post [aw2.get prev_post.url post_id='1045833' in_same_cat='true' /] [aw2.get prev_post.slugpost_id='1045833' in_same_cat='true' take_all_post='yes'] |
To get widgets registered within the sidebar (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get sidebar.sidebar-primary /] |
To get options saved with WordPress (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 2 3 |
[aw2.get option.<key> /] //key of of the option you want the value of [aw2.get option.date_format /] |
To sideload a media to post and get the updated URL (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get sideload_media url='http://www.getawesomestudio.com/wp-content/uploads/2017/02/ux-788002_1920.jpg' post_id='1181341' /] |
To access wpdb object, especially for getting table prefix etc. (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get wpdb dump=true /] |
To access global post object (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get post dump=true /] |
To access active wp_query object (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get wp_query dump=true /] |
To access the details for currently logged in user (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 2 3 |
[aw2.get current_user dump=true /] [aw2.get current_user.data.user_login dump=true /] |
To get the link of a term (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get term_link taxonomy='category' slug='emi-free-loan' /] |
To access the term meta of a taxonomy term (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get term_meta term_id='143' key='agent-email-id' dump=true /] |
To generate a nonce for use (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get nonce.bingo_angle dump=true /] //bingo angle is the key for which nounce wil be greated and saved against. |
To verify the nonce (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get denonce.9690801b57::bingo_angle dump=true /] |
To get all the terms attached to a post (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get taxonomy_term_list post_id='1045833' /] |
To get site url (this is deprecated as of awesome enterprise 3.0 use wp.get instead.)
1 |
[aw2.get url.site /] |