{"id":9408,"date":"2010-06-10T14:22:58","date_gmt":"2010-06-10T14:22:58","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/user-meta-shortcodes\/"},"modified":"2020-07-03T22:59:31","modified_gmt":"2020-07-03T22:59:31","slug":"user-meta-shortcodes","status":"closed","type":"plugin","link":"https:\/\/ve.wordpress.org\/plugins\/user-meta-shortcodes\/","author":5203936,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.5","stable_tag":"0.5","tested":"5.4.19","requires":"2.7","requires_php":"","requires_plugins":"","header_name":"User meta shortcodes","header_author":"Richard Vencu","header_description":"","assets_banners_color":"","last_updated":"2020-07-03 22:59:31","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/vencu.ro\/user-meta-shortcodes\/","header_author_uri":"http:\/\/vencu.ro","rating":4.9,"author_block_rating":0,"active_installs":200,"downloads":12984,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"7"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","0.2","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.3.1","0.4.1","0.5"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[527,683,80,2153,14075],"plugin_category":[43],"plugin_contributors":[82377],"plugin_business_model":[],"class_list":["post-9408","plugin","type-plugin","status-closed","hentry","plugin_tags-custom","plugin_tags-meta","plugin_tags-shortcode","plugin_tags-user","plugin_tags-user-meta","plugin_category-customization","plugin_contributors-rvencu","plugin_committers-rvencu"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/user-meta-shortcodes.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>USAGE:<\/p>\n\n<p>use [userinfo field=\"fieldname\"]some content[\/userinfo] or [authorinfo field=\"fieldname\"]some content[\/authorinfo] shortcodes in your post content to show the \"fieldname\" meta value from the user-meta for the current logged-in user or for the post author without editing your theme files.\nuse [otheruserinfo field=\"fieldname\" login=\"userlogin\" uservar=\"userloginvariable\"]some content[\/otheruserinfo] and use login attribute if you want a fixed user login or uservar attribute if you need to dynamically supply user login via query string, where userloginvariable is the name of the query string variable such as: http:\/\/mysite.com\/mypage\/?userloginvariable=userlogin\nYou may also search for a rewrite plugin to make things nice such as http:\/\/mysite.com\/mypage\/userloginvariable\/userlogin<\/p>\n\n<p>EXAMPLES:<\/p>\n\n<p>[userinfo field=\"last_name\"]{{empty}}[\/userinfo]<\/p>\n\n<p>returns the last name of the current logged-in user. If no user is logged in then the value is empty string<\/p>\n\n<p>[userinfo field=\"user_login\" if=\"admin\"]You are the admin[\/userinfo]<\/p>\n\n<p>this shortcode tests the field against the value and if true it displays the included content<\/p>\n\n<p>[userinfo field=\"user_login\"] is your username and you are reading a post by [authorinfo field=\"user_login\"]{{empty}}[\/authorinfo].[\/userinfo]<\/p>\n\n<p>this will display the username followed with the processed content. Note: never use the nested shortcode same as the enclosing shortcode. This will produce unexpected results!<\/p>\n\n<p>[userinfo nospan=\"true\"] should eliminate the surrounding span tag so the output can be used inside URLs or similar applications<\/p>\n\n<p>[userinfo field=\"avatar\" size=\"50\"] will display the logged-in user's avatar with the size of 50px. The display depends of theme's css class 'avatar'<\/p>\n\n<p>List of some of the available meta field names: ID, user_login, user_pass, user_nicename, user_email, user_url, user_registered, display_name, first_name, last_name,nickname, description, user_level, admin_color (Theme of your admin page. Default is fresh.), closedpostboxes_page, nickname, primary_blog, rich_editing, source_domain<\/p>\n\n<p>[authorinfo field=\"last_name\"]<\/p>\n\n<p>returns the last name of the current post\/page author.<\/p>\n\n<p>[authorinfo field=\"ID\"]<\/p>\n\n<p>returns the user ID of the current post\/page author.<\/p>\n\n<p>[authorinfo field=\"avatar\" size=\"50\"] will display the post author's avatar with the size of 50px. The display depends of theme's css class 'avatar'<\/p>\n\n<p>[authorinfo field=\"posts\"] will display the  author's posts link<\/p>\n\n<p>List of some of the available meta field names: user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name,nickname, first_name, last_name, description, jabber, aim, yim, user_level, user_firstname, user_lastname, user_description, rich_editing, comment_shortcuts, admin_color,plugins_per_page, plugins_last_view, ID<\/p>\n\n<p>[otheruserinfo field=\"user_firstname\" uservar=\"theuserlogin\"] will display the user_firstname for the user specified via query string, in the theuserlogin variable<\/p>\n\n<p>[otheruserinfo field=\"user_firstname\" login=\"admin\"] will display the user firstname for the user specified in the login attribute<\/p>\n\n<p>If you add custom user meta via additional plugins, then the meta should be available for the above shortcodes<\/p>\n\n<!--section=installation-->\n<ol>\n<li><p>Upload <code>user-meta-shortcodes<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/p><\/li>\n<li><p>Activate the plugin through the 'Plugins' menu in WordPress<\/p><\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>Q. Can I use another user besides current user or post author?<\/p>\n\n<p>A. It would be added in future versions of the plugin. I did not received any usage scenarios so far for this feature.<\/p>\n\n<!--section=changelog-->\n<p>0.5 - both nothing and {{empty}} works as no content<\/p>\n\n<p>0.4 - added support for other users by their login. user login can be entered as shortcode attribute or via query string. see usage<\/p>\n\n<p>0.3 - added support for gravatar. added support for link to author posts<\/p>\n\n<p>0.2.5 - added nospan parameter to the shortcodes. setting nospan=\"true\" should eliminate the surrounding span tag from the shortcodes output<\/p>\n\n<p>0.2.4 - replaced Ctrl+M carriage return with regular \\r character in another attempt to fix invalid header errors with Linux hosts. Also fixed a buf for author info shortcode where the author info was displayed for logged in users only<\/p>\n\n<p>0.2.3 - second attempt to fix invalid header error. it seems this problem appears only with certain hosting types<\/p>\n\n<p>0.2.2 - invalid header error fixed (hopefully)<\/p>\n\n<p>0.2.1 - trying to fix invalid header error<\/p>\n\n<p>0.2 - shortcodes accept content now. In addition, conditional display of content by comparing the profile field with a value. Content is only displayed if the values are identical.<\/p>\n\n<p>0.1 - initial version<\/p>","raw_excerpt":"Use user meta as shortcode in post content without editing your theme files.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/9408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=9408"}],"author":[{"embeddable":true,"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/rvencu"}],"wp:attachment":[{"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=9408"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=9408"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=9408"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=9408"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=9408"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ve.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=9408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}