{"_id":"56d88886b159f10b00304622","project":"549a321bf876ae0b00f33623","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"},"parentDoc":null,"__v":1,"user":"549a320d5b50c21400fae689","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-20T04:58:03.168Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_course_short_description_editor_settings\"\n}\n[/block]\nApplied before calling WordPress TinyMCE API. Use to apply custom settings to course short description WYSIWYG.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters( 'lifterlms_course_short_description_editor_settings', $settings ) );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"llms_meta_fields_course_main\"\n}\n[/block]\nApplied to Course Options metabox tabs and fields. Use to add custom tabs and fields to Course Options meta box. \n[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"This filter is under development and likely to change by the next release.\",\n  \"title\": \"THIS FILTER IS UNDER DEVELOPMENT\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filters('llms_meta_fields_course_main', $meta_fields_course_main);\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_product_purchase_account_redirect\"\n}\n[/block]\nApplies to \"Take This Course\" Button\n\nFilter the redirect url when users are redirected to purchase the course.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_product_purchase_redirect_membership_required\"\n}\n[/block]\nApplies to \"Take This Course\" Button\n\nFilter the redirect url when users are redirected to view a required membership.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_product_purchase_checkout_redirect\"\n}\n[/block]\nApplies to \"Take This Course\" Button\n\nFilter the redirect url when users are redirected to the checkout page.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_product_purchase_membership_redirect\"\n}\n[/block]\nApplies to \"Take This Course\" Button\n\nFilter the redirect url when users are redirected to purchase a required membership.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php // don't include this lin when adding to a functions.php\\n\\n/**\\n * Redirect users to an arbitrary page instead of the default membership page when they click the \\\"Become a Member\\\" button\\n * :::at:::param  string $url default membership page URL\\n * @return string \\n */\\nfunction my_memembership_purchase_redirect( $url ) {\\n\\n\\treturn get_permalink( 123 );\\n\\n}\\n\\nadd_filter( 'lifterlms_product_purchase_membership_redirect', 'my_memembership_purchase_redirect', 10, 1 );\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"lifterlms_lesson_complete_icon\"\n}\n[/block]\nCustomize the lesson complete icon. LifterLMS uses the [font-awesome library](https://fortawesome.github.io/Font-Awesome/icons/) for icons. \n\n**Example: **Let's say you wanted to change the lesson completion icon from the checkmark to a cup of coffee. Browse the [font-awesome library page](https://fortawesome.github.io/Font-Awesome/icons/) until you find the icon you want to use. Then apply the filter to the lesson complete icon and pass the icon name \"coffee\" *Example Below:* \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"apply_filter('lifterlms_lesson_complete_icon', 'change_lesson_icon');\\n\\nfunction change_lesson_icon($icon)\\n{\\n\\t$icon = 'coffee';\\n\\n  return $icon;\\n}\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"filters-course","type":"basic","title":"Filters: Course"}
[block:api-header] { "type": "basic", "title": "lifterlms_course_short_description_editor_settings" } [/block] Applied before calling WordPress TinyMCE API. Use to apply custom settings to course short description WYSIWYG. [block:code] { "codes": [ { "code": "apply_filters( 'lifterlms_course_short_description_editor_settings', $settings ) );", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "llms_meta_fields_course_main" } [/block] Applied to Course Options metabox tabs and fields. Use to add custom tabs and fields to Course Options meta box. [block:callout] { "type": "danger", "body": "This filter is under development and likely to change by the next release.", "title": "THIS FILTER IS UNDER DEVELOPMENT" } [/block] [block:code] { "codes": [ { "code": "apply_filters('llms_meta_fields_course_main', $meta_fields_course_main);", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_product_purchase_account_redirect" } [/block] Applies to "Take This Course" Button Filter the redirect url when users are redirected to purchase the course. [block:api-header] { "type": "basic", "title": "lifterlms_product_purchase_redirect_membership_required" } [/block] Applies to "Take This Course" Button Filter the redirect url when users are redirected to view a required membership. [block:api-header] { "type": "basic", "title": "lifterlms_product_purchase_checkout_redirect" } [/block] Applies to "Take This Course" Button Filter the redirect url when users are redirected to the checkout page. [block:api-header] { "type": "basic", "title": "lifterlms_product_purchase_membership_redirect" } [/block] Applies to "Take This Course" Button Filter the redirect url when users are redirected to purchase a required membership. [block:code] { "codes": [ { "code": "<?php // don't include this lin when adding to a functions.php\n\n/**\n * Redirect users to an arbitrary page instead of the default membership page when they click the \"Become a Member\" button\n * @param string $url default membership page URL\n * @return string \n */\nfunction my_memembership_purchase_redirect( $url ) {\n\n\treturn get_permalink( 123 );\n\n}\n\nadd_filter( 'lifterlms_product_purchase_membership_redirect', 'my_memembership_purchase_redirect', 10, 1 );", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "lifterlms_lesson_complete_icon" } [/block] Customize the lesson complete icon. LifterLMS uses the [font-awesome library](https://fortawesome.github.io/Font-Awesome/icons/) for icons. **Example: **Let's say you wanted to change the lesson completion icon from the checkmark to a cup of coffee. Browse the [font-awesome library page](https://fortawesome.github.io/Font-Awesome/icons/) until you find the icon you want to use. Then apply the filter to the lesson complete icon and pass the icon name "coffee" *Example Below:* [block:code] { "codes": [ { "code": "apply_filter('lifterlms_lesson_complete_icon', 'change_lesson_icon');\n\nfunction change_lesson_icon($icon)\n{\n\t$icon = 'coffee';\n\n return $icon;\n}", "language": "php" } ] } [/block]