{"id":1963852,"date":"2025-01-02T01:19:49","date_gmt":"2025-01-02T06:19:49","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?p=1963852"},"modified":"2025-01-02T01:19:51","modified_gmt":"2025-01-02T06:19:51","slug":"export-attendees-allow-access-to-custom-user-roles","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/export-attendees-allow-access-to-custom-user-roles\/","title":{"rendered":"Export Attendees &#8211; Allow Access to Custom User Roles"},"content":{"rendered":"\n<p>By default, the capability to <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/tickets-managing-your-orders-and-attendees\/\" target=\"_blank\" rel=\"noreferrer noopener\">export attendees<\/a> within the <a href=\"https:\/\/theeventscalendar.com\/products\/wordpress-event-tickets\/\">Event Tickets<\/a> plugin is assigned to users with the <code>publish_pages<\/code> <a href=\"https:\/\/wordpress.org\/documentation\/article\/roles-and-capabilities\/\" target=\"_blank\" rel=\"noreferrer noopener\">capability<\/a>, including Super Admins, Admins, and Editors. However, organizations may wish to extend this functionality to custom <a href=\"https:\/\/wordpress.org\/documentation\/article\/roles-and-capabilities\/\" target=\"_blank\" rel=\"noreferrer noopener\">user roles<\/a>. The <code>tec_tickets_attendees_user_can_export_csv<\/code> filter hook can be utilized to grant the necessary permissions to these roles.<\/p>\n\n\n\n<p>To enable custom user roles to export attendees, add the following PHP code to your site:<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/masoodahmed\/7e018381ee44960f06780fb15cc5ca12.js\"><\/script>\n\n\n\n<p>Add the code snippet to the <em>functions.php<\/em> file of your theme, or use your preferred method for integrating snippets into your WordPress site, such as the free <a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\" target=\"_blank\" rel=\"noreferrer noopener\">Code Snippets<\/a> plugin.<\/p>\n\n\n\n<p>This code snippet leverages the <code>tec_tickets_attendees_user_can_export_csv<\/code> filter to assess the capabilities of the current user. If the user possesses the specified custom role (ensure that <code>your_custom_role<\/code> is replaced with the actual role slug), the filter permits the user to export the attendee.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, the capability to export attendees within the Event Tickets plugin is assigned to users with the publish_pages capability, including Super Admins, Admins, and Editors. However, organizations may wish to extend this functionality to custom user roles. The tec_tickets_attendees_user_can_export_csv filter hook can be utilized to grant the necessary permissions to these roles. To enable&#8230;<\/p>\n","protected":false},"author":59,"featured_media":1955565,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[24,59,79],"tags":[20,25,36,58,212],"stellar-product-taxonomy":[155,156],"class_list":["post-1963852","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-customizing","category-customizing-resources","category-snippets","tag-code","tag-customizations","tag-exporting","tag-php","tag-snippets","stellar-product-taxonomy-event-tickets","stellar-product-taxonomy-event-tickets-plus"],"acf":[],"taxonomy_info":{"category":[{"value":24,"label":"Customizations"},{"value":59,"label":"PHP &amp; Functions"},{"value":79,"label":"Snippets"}],"post_tag":[{"value":20,"label":"Code"},{"value":25,"label":"Customizations"},{"value":36,"label":"Exporting"},{"value":58,"label":"PHP"},{"value":212,"label":"snippets"}],"stellar-product-taxonomy":[{"value":155,"label":"Event Tickets"},{"value":156,"label":"Event Tickets Plus"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Masood","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/masood\/"},"comment_info":0,"category_info":[{"term_id":24,"name":"Customizations","slug":"customizing","term_group":0,"term_taxonomy_id":24,"taxonomy":"category","description":"","parent":0,"count":110,"filter":"raw","term_order":"0","cat_ID":24,"category_count":110,"category_description":"","cat_name":"Customizations","category_nicename":"customizing","category_parent":0},{"term_id":59,"name":"PHP &amp; Functions","slug":"customizing-resources","term_group":0,"term_taxonomy_id":59,"taxonomy":"category","description":"","parent":24,"count":101,"filter":"raw","term_order":"0","cat_ID":59,"category_count":101,"category_description":"","cat_name":"PHP &amp; Functions","category_nicename":"customizing-resources","category_parent":24},{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":136,"filter":"raw","term_order":"0","cat_ID":79,"category_count":136,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0}],"tag_info":[{"term_id":20,"name":"Code","slug":"code","term_group":0,"term_taxonomy_id":20,"taxonomy":"post_tag","description":"","parent":0,"count":33,"filter":"raw","term_order":"0"},{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":177,"filter":"raw","term_order":"0"},{"term_id":36,"name":"Exporting","slug":"exporting","term_group":0,"term_taxonomy_id":36,"taxonomy":"post_tag","description":"","parent":0,"count":10,"filter":"raw","term_order":"0"},{"term_id":58,"name":"PHP","slug":"php","term_group":0,"term_taxonomy_id":58,"taxonomy":"post_tag","description":"","parent":20,"count":128,"filter":"raw","term_order":"0"},{"term_id":212,"name":"snippets","slug":"snippets","term_group":0,"term_taxonomy_id":212,"taxonomy":"post_tag","description":"","parent":0,"count":17,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1963852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/59"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1963852"}],"version-history":[{"count":1,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1963852\/revisions"}],"predecessor-version":[{"id":1963853,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1963852\/revisions\/1963853"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1963852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1963852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1963852"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1963852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}