Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion assets/icons/droip-colorized.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/icons/elementor-colorized.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/icons/gutenberg-colorized.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/icons/kirki-colorized.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
4 changes: 2 additions & 2 deletions assets/src/js/v3/shared/components/fields/FormWPEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ interface CustomEditorOverlayProps {
}

const customEditorIcons: { [key: string]: IconCollection } = {
droip: 'droipColorized',
kirki: 'kirkiColorized',
elementor: 'elementorColorized',
gutenberg: 'gutenbergColorized',
divi: 'diviColorized',
Expand Down Expand Up @@ -189,7 +189,7 @@ const FormWPEditor = ({
const [customEditorLoading, setCustomEditorLoading] = useState<string | null>(null);

const filteredEditors = editors.filter(
(editor) => isAdmin || (isInstructor && hasWpAdminAccess) || editor.name === 'droip',
(editor) => isAdmin || (isInstructor && hasWpAdminAccess) || editor.name === 'kirki',
);

const hasAvailableCustomEditors = hasCustomEditorSupport && filteredEditors.length > 0;
Expand Down
5 changes: 3 additions & 2 deletions assets/src/js/v3/shared/icons/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ export const icons = [
'downloadColorize',
'drag',
'dragVertical',
'droip',
'droipColorized',
'drop',
'duplicate',
'dwg',
Expand All @@ -163,6 +161,7 @@ export const icons = [
'email',
'emailNotification',
'energy',
'enroll',
'enrolled',
'enter',
'eraser',
Expand Down Expand Up @@ -235,6 +234,8 @@ export const icons = [
'json',
'jsonFile',
'key',
'kirki',
'kirkiColorized',
'landscape',
'landscapeFilled',
'league',
Expand Down
4 changes: 2 additions & 2 deletions classes/Course.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@
} else {
$errors['pricing'] = __( 'Invalid product', 'tutor' );
}
} else {

Check failure on line 696 in classes/Course.php

View workflow job for this annotation

GitHub Actions / WPCS

If control structure block found as the only statement within an &quot;else&quot; block. Use elseif instead.

Check failure on line 696 in classes/Course.php

View workflow job for this annotation

GitHub Actions / WPCS

If control structure block found as the only statement within an &quot;else&quot; block. Use elseif instead.
/**
* If user does not select WC product
* Then automatic WC product will be create name with course title.
Expand Down Expand Up @@ -830,7 +830,7 @@
update_post_meta( $post_id, self::COURSE_PRICE_TYPE_META, $params['pricing']['type'] );
}
} catch ( \Throwable $th ) {
throw new \Exception( $th->getMessage() );

Check failure on line 833 in classes/Course.php

View workflow job for this annotation

GitHub Actions / WPCS

All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$th'.

Check failure on line 833 in classes/Course.php

View workflow job for this annotation

GitHub Actions / WPCS

All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$th'.
}
}

Expand Down Expand Up @@ -1035,7 +1035,7 @@
public function ajax_create_course() {
tutor_utils()->check_nonce();

$course_id = intval( wp_unslash( $_POST['ID'] ?? 0 ) );

Check failure on line 1038 in classes/Course.php

View workflow job for this annotation

GitHub Actions / WPCS

Processing form data without nonce verification.

Check failure on line 1038 in classes/Course.php

View workflow job for this annotation

GitHub Actions / WPCS

Processing form data without nonce verification.
$this->check_access( $course_id ); // Check user cap for the given id before processing.

$params = Input::sanitize_array(
Expand Down Expand Up @@ -1240,8 +1240,8 @@
$post_content = (string) get_post_field( 'post_content', $course_id, 'raw' );
if ( 'elementor' === $builder ) {
delete_post_meta( $course_id, '_elementor_edit_mode' );
} elseif ( 'droip' === $builder ) {
delete_post_meta( $course_id, 'droip_editor_mode' );
} elseif ( 'kirki' === $builder ) {
delete_post_meta( $course_id, 'kirki_editor_mode' );
} elseif ( 'divi' === $builder ) {
$post_content = get_post_meta( $course_id, '_et_pb_old_content', true );
$course = get_post( $course_id );
Expand Down
4 changes: 2 additions & 2 deletions classes/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ final class Icon {
const DOWNLOAD_COLORIZE = 'download-colorize';
const DRAG = 'drag';
const DRAG_VERTICAL = 'drag-vertical';
const DROIP = 'droip';
const DROIP_COLORIZED = 'droip-colorized';
const DROP = 'drop';
const DUPLICATE = 'duplicate';
const DWG = 'dwg';
Expand Down Expand Up @@ -254,6 +252,8 @@ final class Icon {
const JSON = 'json';
const JSON_FILE = 'json-file';
const KEY = 'key';
const KIRKI = 'kirki';
const KIRKI_COLORIZED = 'kirki-colorized';
const LANDSCAPE = 'landscape';
const LANDSCAPE_FILLED = 'landscape-filled';
const LEAGUE = 'league';
Expand Down
12 changes: 6 additions & 6 deletions classes/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@
$user_id = $this->get_user_id( $user_id );

// Delete Quiz submissions.
$attempts = \Tutor\Models\QuizModel::get_quiz_attempts_by_course_ids( $start = 0, $limit = 99999999, $course_ids = array( $course_id ), $search_filter = '', $course_filter = '', $date_filter = '', $order_filter = '', $user_id = $user_id, false, true );

Check failure on line 1339 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Assignments must be the first block of code on a line

Check failure on line 1339 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Assignments must be the first block of code on a line

if ( is_array( $attempts ) ) {
$attempt_ids = array_map(
Expand Down Expand Up @@ -1514,7 +1514,7 @@
ON topic.ID = items.post_parent
WHERE topic.post_parent = %d
AND items.post_status = %s
" . ( $post_type ? " AND items.post_type='{$post_type}' " : '' ) . '

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found :

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found interpolated variable {$post_type} at &quot; AND items.post_type='{$post_type}' &quot;

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found ?

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found $post_type

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found :

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found interpolated variable {$post_type} at &quot; AND items.post_type='{$post_type}' &quot;

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found ?

Check failure on line 1517 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found $post_type
ORDER BY topic.menu_order ASC,
items.menu_order ASC;
',
Expand Down Expand Up @@ -2147,8 +2147,8 @@
ON user.ID = posts.post_author
WHERE posts.post_type = %s
AND posts.post_status = %s
{$course_query}

Check failure on line 2150 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found interpolated variable {$course_query} at {$course_query}&#10;

Check failure on line 2150 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found interpolated variable {$course_query} at {$course_query}&#10;
{$date_query}

Check failure on line 2151 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found interpolated variable {$date_query} at {$date_query}&#10;

Check failure on line 2151 in classes/Utils.php

View workflow job for this annotation

GitHub Actions / WPCS

Use placeholders and $wpdb-&gt;prepare(); found interpolated variable {$date_query} at {$date_query}&#10;
AND (user.display_name LIKE %s OR user.user_email = %s OR user.user_login LIKE %s)
GROUP BY post_author
{$order_query}
Expand Down Expand Up @@ -10176,14 +10176,14 @@
);
}

if ( is_plugin_active( 'droip/droip.php' ) ) {
$name = 'droip';
if ( is_plugin_active( 'kirki/kirki.php' ) ) {
$name = 'kirki';
$editors[ $name ] = array(
'name' => $name,
'label' => __( 'Droip', 'tutor' ),
'label' => __( 'Kirki', 'tutor' ),
'link' => add_query_arg(
array(
'action' => 'droip',
'action' => 'kirki',
'post_id' => $post_id,
),
get_permalink( $post_id )
Expand Down Expand Up @@ -10239,8 +10239,8 @@
$name = 'elementor';
}

if ( 'droip' === get_post_meta( $post_id, 'droip_editor_mode', true ) ) {
$name = 'droip';
if ( 'kirki' === get_post_meta( $post_id, 'kirki_editor_mode', true ) ) {
$name = 'kirki';
}

$editor_list = $this->get_editor_list( $post_id );
Expand Down
Loading