-
Notifications
You must be signed in to change notification settings - Fork 82
Moved certificate and webinar to pro and Updated Webinar styles #2315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
templates/learning-area/index.php
Outdated
| $is_pro = false; | ||
|
|
||
| // Pro subpages. | ||
| $pro_subpages = array( 'webinar', 'certificate' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should manage this using hooks
| } | ||
| } | ||
|
|
||
| &-body { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not move this file to pro as well?
classes/Template.php
Outdated
|
|
||
| $menu_items = array( | ||
| 'resources' => array( | ||
| 'title' => esc_html__( 'Resources', 'tutor' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not rendering. So do not use esc function. Use esc function only on rendering
classes/Template.php
Outdated
| 'title' => __( 'Resources', 'tutor' ), | ||
| 'icon' => Icon::RESOURCES, | ||
| 'url' => UrlHelper::add_query_params( $base_url, array( 'subpage' => 'resources' ) ), | ||
| 'is_pro' => false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use this key. If not exist than default is false
classes/Template.php
Outdated
| 'title' => __( 'Q&A', 'tutor' ), | ||
| 'icon' => Icon::QA, | ||
| 'url' => UrlHelper::add_query_params( $base_url, array( 'subpage' => 'qna' ) ), | ||
| 'is_pro' => false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
templates/learning-area/index.php
Outdated
|
|
||
| if ( $subpage ) { | ||
| $subpage_template = tutor_get_template( 'learning-area.subpages.' . $subpage ); | ||
| $is_pro = isset( $subpages[ $subpage ] ) && $subpages[ $subpage ]['is_pro']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding 'template` key in pages array. We can simplify this
$template = $subpages[$subpage]['template'] ?? '';
if ( $template && file_exists( $template ) ) {
tutor_load_template_from_custom_path( $template );
}
Overview
In this pr I have moved the webinar and certificate page in learning area from free to pro as these are pro features. I have used the hook
tutor_learning_area_sub_page_nav_itemto add the two nav button of webinar and certificate from pro. Furthermore, I have used the structuretemplates > learning-area > subpage > webinar.phpto create the templates in pro so in free I check the sub page if it has any of the pro template I make theis_proflag to true which loads the template. I have also done some design fixes for webinar page in learning area.