-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dev #1
Conversation
'type' => 'success', | ||
) | ||
); | ||
} else { |
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.
Else is not required
if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( sanitize_key( $_POST['nonce'] ), 'mark_complete_nonce' ) ) { | ||
wp_send_json_error( | ||
array( | ||
'message' => __( 'Please provide proper nonce', 'ld_custom_auto_complete' ), |
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.
If this message is available to end users, a filter for the message can be added.
*/ | ||
public function ld_custom_autocomplete_topic( $post_id, $course_id, $user_id ) { | ||
$is_autocomplete_on = get_post_meta( $post_id, LD_CUSTOM_AUTO_COMPLETE_META, true ); | ||
if ( 'on' === $is_autocomplete_on ) { |
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.
Early return is possible
function () { | ||
if ( jQuery( '.learndash_timer' ).length ) { | ||
jQuery( '.learndash_timer' ).each( | ||
function ( idx, item ) { |
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.
Add comments for the functions. Also, variable names need to reflect what they represent
@@ -0,0 +1,35 @@ | |||
<?php |
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.
Is this file still required?
*/ | ||
public function ld_custom_autocomplete_add_setting( $setting_option_fields = array(), $settings_metabox_key = '' ) { | ||
|
||
if ( 'learndash-topic-display-content-settings' === $settings_metabox_key || 'learndash-lesson-display-content-settings' === $settings_metabox_key ) { |
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.
Early return
); | ||
$help_text = sprintf( | ||
// translators: placeholder: lesson. | ||
esc_html_x( 'Turning this on will allow you to autocomplete %s.', 'placeholder: Lesson.', 'learndash' ), |
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.
The text domain is incorrect. Generate a pot file and confirm whether all the strings show up for translation.
No description provided.