Skip to content
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

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Dev #1

merged 2 commits into from
Aug 30, 2024

Conversation

Archinj
Copy link
Contributor

@Archinj Archinj commented Aug 30, 2024

No description provided.

@Archinj Archinj merged commit 39453ee into main Aug 30, 2024
1 check failed
'type' => 'success',
)
);
} else {
Copy link
Collaborator

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' ),
Copy link
Collaborator

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 ) {
Copy link
Collaborator

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 ) {
Copy link
Collaborator

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
Copy link
Collaborator

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 ) {
Copy link
Collaborator

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' ),
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants