{"_id":"56d88886b159f10b0030462a","__v":0,"parentDoc":null,"version":{"_id":"56d88884b159f10b00304609","__v":3,"project":"549a321bf876ae0b00f33623","createdAt":"2016-03-03T18:55:00.567Z","releaseDate":"2016-03-03T18:55:00.567Z","categories":["56d88885b159f10b0030460a","56d88885b159f10b0030460b","56d88885b159f10b0030460c","56d88885b159f10b0030460d","56d88885b159f10b0030460e","56d88885b159f10b0030460f","56d88885b159f10b00304610","56d88885b159f10b00304611","56d88885b159f10b00304612","56d88885b159f10b00304613","56d88885b159f10b00304614","56d89250b159f10b003046d4","56da13977222d50b0070167c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.2.1","version":"2.2.1"},"project":"549a321bf876ae0b00f33623","user":"549a320d5b50c21400fae689","category":{"_id":"56d88885b159f10b00304613","pages":["56d88886b159f10b0030461c","56d88886b159f10b0030461d","56d88886b159f10b0030461e","56d88886b159f10b0030461f","56d88886b159f10b00304620","56d88886b159f10b00304621","56d88886b159f10b00304622","56d88886b159f10b00304623","56d88886b159f10b00304624","56d88886b159f10b00304625","56d88886b159f10b00304626","56d88886b159f10b00304627","56d88886b159f10b00304628","56d88886b159f10b00304629","56d88886b159f10b0030462a","56d88886b159f10b0030462b","56d88886b159f10b0030462c","56d88886b159f10b0030462d","56d88886b159f10b0030462e","56d88886b159f10b0030462f","56d88886b159f10b00304630","56d88886b159f10b00304631"],"project":"549a321bf876ae0b00f33623","__v":1,"version":"56d88884b159f10b00304609","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-20T00:49:50.639Z","from_sync":false,"order":10,"slug":"developer-api","title":"Filters Reference"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-13T19:29:48.514Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":14,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"In version 1.4.5 LifterLMS Permissions were hardened!\",\n  \"body\": \"Prior to version 1.4.5, permission defaults allowed any WordPress users with the \\\"edit_posts\\\" capability to access LifterLMS courses, memberships, settings pages as well as student and general analytics. In version 1.4.5 we hardened these permissions to allow only users with \\\"manage_options\\\" capabilities to access all of these areas.\\n\\nUse a combination of the filters below to restore your LifterLMS to the pre 1.4.5 defaults.\"\n}\n[/block]\nAccess to the LifterLMS admin menu, various screens, and various posts utilized by the plugin are determined by having access to a specific WordPress capability.\n\nThe default capability for all LifterLMS access is \"manage_options.\" The WordPress Role which has this capability, by default, is the \"Administrator\" role. If you wish to provide other roles with access to LifterLMS screens and post types, you must utilize one or several of the filters below.\n\nFor a comprehensive list of existing WordPress capabilities, check the WordPress Codex entry at [http://codex.wordpress.org/Roles_and_Capabilities#Capabilities](http://codex.wordpress.org/Roles_and_Capabilities#Capabilities).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_menu_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the main LifterLMS Menu on the WordPress admin panel.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the main LifterLMS menu\\n * :::at:::param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_menu_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n  \\n}\\n// add your filter\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_menu_access', 10, 1 ); // display the main menu!\\n?>\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Enabling the admin menu without any additional permissions will result in an empty menu displaying!*\",\n  \"body\": \"In order for a user to view anything displayed in the menu, they must first have access to the menu. Providing access to a screen without access to the menu means the user will not be able to navigate to the screen. For this reason, in our examples below we've included this filter with almost every additional filter.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_settings_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS Settings screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the settings post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_settings_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_settings_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_settings_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_settings_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_analytics_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS analytics screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the analytics post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_analytics_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_analytics_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_analytics_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_analytics_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_students_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS students screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the students post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_students_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_students_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_students_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_students_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_membership_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS Memberships screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the Memberships post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_memberships_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n  \\n}\\n// add your filter\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_memberships_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_memberships_access', 10, 1 ); // display the memberships screen\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterslm_admin_membership_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_emails_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS Emails screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the emails post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_emails_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filter\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_emails_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_emails_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"text\",\n      \"name\": \"lifterlms_admin_emails_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_certificates_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS Certificates screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the certificates post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_certificates_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_certificates_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_certificates_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_achievements_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS Achievements screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the achievements post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_achievements_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_achievements_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_achievements_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_achievements_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_engagements_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS Engagements screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the engagements post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_engagements_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_engagements_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_engagements_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_engagements_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_orders_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS orders screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the orders post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_orders_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_orders_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_orders_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_orders_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_coupons_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS coupons screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the coupons post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_coupons_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_coupons_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_coupons_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_coupons_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_reviews_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS reviews screen on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the reviews post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_reviews_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_reviews_access', 10, 1 ); // display the main menu!\\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_reviews_access', 10, 1 ); // display the\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_reviews_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_courses_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS courses screen and menu on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the courses post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_courses_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_courses_access', 'my_llms_courses_access', 10, 1 ); // display the courses post type\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_courses_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_vouchers_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS vouchers screen and menu on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the vouchers post type\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_vouchers_access( $capability )\\n{\\n\\n\\t// you can define any valid WordPress capability here\\n\\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n\\t$capability = 'edit_posts'; \\n\\n\\treturn $capability;\\n\\n}\\n// add your filters\\nadd_filter( 'lifterlms_admin_vouchers_access', 'my_llms_vouchers_access', 10, 1 ); // display the vouchers post type\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_vouchers_access.php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_admin_system_report_access\"\n}\n[/block]\nModify the WordPress capability which a user requires in order to see the LifterLMS system report screen and menu on the main LifterLMS menu.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n/**\\n * Allow WP users with the \\\"edit_posts\\\" capability to access the system report page\\n * @param  string $capability   default capability for access (\\\"manage_options\\\")\\n * @return string               modified capability for access\\n */\\nfunction my_llms_system_report_access( $capability )\\n{\\n\\n  // you can define any valid WordPress capability here\\n  // see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\\n  $capability = 'edit_posts'; \\n\\n  return $capability;\\n\\n}\\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_reviews_access', 10, 1 ); // display the main menu!\\n// add your filters\\nadd_filter( 'lifterlms_admin_system_report_access', 'my_llms_system_report_access', 10, 1 ); // display the vouchers post type\\n?>\",\n      \"language\": \"php\",\n      \"name\": \"lifterlms_admin_system_report_access.php\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"filters-admin-menu-and-screen-permissions","type":"basic","title":"Filters: Permissions for Admin Menu and Screens"}

Filters: Permissions for Admin Menu and Screens


[block:callout] { "type": "warning", "title": "In version 1.4.5 LifterLMS Permissions were hardened!", "body": "Prior to version 1.4.5, permission defaults allowed any WordPress users with the \"edit_posts\" capability to access LifterLMS courses, memberships, settings pages as well as student and general analytics. In version 1.4.5 we hardened these permissions to allow only users with \"manage_options\" capabilities to access all of these areas.\n\nUse a combination of the filters below to restore your LifterLMS to the pre 1.4.5 defaults." } [/block] Access to the LifterLMS admin menu, various screens, and various posts utilized by the plugin are determined by having access to a specific WordPress capability. The default capability for all LifterLMS access is "manage_options." The WordPress Role which has this capability, by default, is the "Administrator" role. If you wish to provide other roles with access to LifterLMS screens and post types, you must utilize one or several of the filters below. For a comprehensive list of existing WordPress capabilities, check the WordPress Codex entry at [http://codex.wordpress.org/Roles_and_Capabilities#Capabilities](http://codex.wordpress.org/Roles_and_Capabilities#Capabilities). [block:api-header] { "type": "basic", "title": "lifterlms_admin_menu_access" } [/block] Modify the WordPress capability which a user requires in order to see the main LifterLMS Menu on the WordPress admin panel. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the main LifterLMS menu\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_menu_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n \n}\n// add your filter\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_menu_access', 10, 1 ); // display the main menu!\n?>", "language": "php" } ] } [/block] [block:callout] { "type": "warning", "title": "Enabling the admin menu without any additional permissions will result in an empty menu displaying!*", "body": "In order for a user to view anything displayed in the menu, they must first have access to the menu. Providing access to a screen without access to the menu means the user will not be able to navigate to the screen. For this reason, in our examples below we've included this filter with almost every additional filter." } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_settings_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS Settings screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the settings post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_settings_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_settings_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_settings_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_settings_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_analytics_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS analytics screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the analytics post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_analytics_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_analytics_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_analytics_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_analytics_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_students_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS students screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the students post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_students_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_students_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_students_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_students_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_membership_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS Memberships screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the Memberships post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_memberships_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n \n}\n// add your filter\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_memberships_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_memberships_access', 10, 1 ); // display the memberships screen\n?>", "language": "php", "name": "lifterslm_admin_membership_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_emails_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS Emails screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the emails post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_emails_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filter\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_emails_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_emails_access', 10, 1 ); // display the\n?>", "language": "text", "name": "lifterlms_admin_emails_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_certificates_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS Certificates screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the certificates post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_certificates_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_certificates_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_certificates_access', 10, 1 ); // display the\n?>", "language": "text" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_achievements_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS Achievements screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the achievements post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_achievements_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_achievements_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_achievements_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_achievements_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_engagements_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS Engagements screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the engagements post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_engagements_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_engagements_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_engagements_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_engagements_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_orders_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS orders screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the orders post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_orders_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_orders_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_orders_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_orders_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_coupons_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS coupons screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the coupons post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_coupons_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_coupons_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_coupons_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_coupons_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_reviews_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS reviews screen on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the reviews post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_reviews_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_reviews_access', 10, 1 ); // display the main menu!\nadd_filter( 'lifterlms_admin_membership_access', 'my_llms_reviews_access', 10, 1 ); // display the\n?>", "language": "php", "name": "lifterlms_admin_reviews_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_courses_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS courses screen and menu on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the courses post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_courses_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_courses_access', 'my_llms_courses_access', 10, 1 ); // display the courses post type\n?>", "language": "php", "name": "lifterlms_admin_courses_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_vouchers_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS vouchers screen and menu on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the vouchers post type\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_vouchers_access( $capability )\n{\n\n\t// you can define any valid WordPress capability here\n\t// see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n\t$capability = 'edit_posts'; \n\n\treturn $capability;\n\n}\n// add your filters\nadd_filter( 'lifterlms_admin_vouchers_access', 'my_llms_vouchers_access', 10, 1 ); // display the vouchers post type\n?>", "language": "php", "name": "lifterlms_admin_vouchers_access.php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_admin_system_report_access" } [/block] Modify the WordPress capability which a user requires in order to see the LifterLMS system report screen and menu on the main LifterLMS menu. [block:code] { "codes": [ { "code": "<?php\n/**\n * Allow WP users with the \"edit_posts\" capability to access the system report page\n * @param string $capability default capability for access (\"manage_options\")\n * @return string modified capability for access\n */\nfunction my_llms_system_report_access( $capability )\n{\n\n // you can define any valid WordPress capability here\n // see http://codex.wordpress.org/Roles_and_Capabilities#Capabilities for a comprehensive list of capabilties\n $capability = 'edit_posts'; \n\n return $capability;\n\n}\nadd_filter( 'lifterlms_admin_menu_access', 'my_llms_reviews_access', 10, 1 ); // display the main menu!\n// add your filters\nadd_filter( 'lifterlms_admin_system_report_access', 'my_llms_system_report_access', 10, 1 ); // display the vouchers post type\n?>", "language": "php", "name": "lifterlms_admin_system_report_access.php" } ] } [/block]