-
Notifications
You must be signed in to change notification settings - Fork 82
Instructor Home Page ( Functionalities ) #2329
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
base: 4.0.0-dev
Are you sure you want to change the base?
Conversation
| */ | ||
|
|
||
| namespace 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.
Use direct access prevention code here
defined( 'ABSPATH' ) || exit;
classes/Instructor.php
Outdated
|
|
||
| $diff = ! empty( $start_date ) && ! empty( $end_date ) ? $current_data - $previous_data : $previous_data; | ||
| $symbol = $diff < 0 ? '-' : ( $diff > 0 ? '+' : '' ); | ||
| $diff = $price ? wp_kses_post( tutor_utils()->tutor_price( abs( $diff ) ) ) : abs( $diff ); |
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 here, why need wp_kses_post
classes/Instructor.php
Outdated
|
|
||
| $time_zone = wp_timezone(); | ||
| $now = new DateTime( 'now', $time_zone ); | ||
| $today = wp_date( 'Y-m-d', null, $time_zone ); |
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.
Use DateTimeHelper
$format = DateTimeHelper::FORMAT_DATE;
$now = DateTimeHelper::now()->set_timezone( wp_timezone() );
$today = $now->format( $format );
$this_month_start = $now->create( 'first day of this month' )->format( $format );
$this_month_end = $now->create( 'last day of this month' )->format( $format );
...
...
classes/Instructor.php
Outdated
| public static function get_comparison_date_range( $selected_start_date, $selected_end_date ) { | ||
|
|
||
| if ( empty( $selected_start_date ) && empty( $selected_end_date ) ) { | ||
| $now = new DateTime(); |
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.
Use DateTimeHelper
classes/Utils.php
Outdated
| * @return string|null Returns the SVG markup when `$return` is true, otherwise null. | ||
| */ | ||
| public function render_svg_icon( $name, $width = 16, $height = 16, $attributes = array() ) { | ||
| public function render_svg_icon( $name, $width = 16, $height = 16, $attributes = array(), $return = false ): ?string { |
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.
This method is named for direct rendering. Use buffer to get string or make get_svg_icon method and use it inside render_svg_icon
| } | ||
| } | ||
|
|
||
| // $upcoming_tasks = array( |
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.
Remove dummy data code
templates/dashboard/dashboard.php
Outdated
| </div> | ||
| <?php | ||
| $i++; | ||
| ++$i; |
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 this change?
| * @link https://themeum.com | ||
| * @since 1.4.3 | ||
| */ | ||
|
|
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.
Prevent direct access defined( 'ABSPATH' ) || exit;
| * @link https://themeum.com | ||
| * @since 4.0.0 | ||
| */ | ||
|
|
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 this file change?
|
|
||
| use TUTOR\Icon; | ||
| /** | ||
| * Star Rating Component |
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 this file change?
No description provided.