Skip to content

Course Outline: Add CSS class to lessons blocked by content dripping#7935

Open
Drivingralle wants to merge 1 commit into
Automattic:trunkfrom
Drivingralle:7934
Open

Course Outline: Add CSS class to lessons blocked by content dripping#7935
Drivingralle wants to merge 1 commit into
Automattic:trunkfrom
Drivingralle:7934

Conversation

@Drivingralle
Copy link
Copy Markdown

Resolves #7934

Proposed Changes

Add a pending CSS class to the lesson <a> element in render_lesson_block() when the lesson is blocked by content dripping for the current user. The check is guarded with function_exists( 'Sensei_Content_Drip' ) so it has no effect when the Content Drip module is inactive.

Testing Instructions

  1. Set up a course with content dripping enabled on one or more lessons
    (absolute or dynamic drip type).
  2. Log in as a student who is enrolled but does not yet have access to
    the dripped lesson.
  3. View the course page and inspect the lesson link in the course
    outline — it should have both
    wp-block-sensei-lms-course-outline-lesson and pending in its class
    attribute.
  4. Log in as a student who does have access — the pending class
    should not be present.
  5. Deactivate the Content Drip module and confirm no errors occur and
    the class is absent.

New/Updated Hooks

  • None

Deprecated Code

  • None

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately
    describe the changes
  • Adheres to coding standards ([PHP](https://developer.wordpress.or
    g/coding-standards/wordpress-coding-standards/php/),
    [JavaScript](https://developer.wordpress.org/coding-standards/wordpress
    -coding-standards/javascript/), [CSS](https://developer.wordpress.org/c
    oding-standards/wordpress-coding-standards/css/), [HTML](https://develo
    per.wordpress.org/coding-standards/wordpress-coding-standards/html/))
  • All strings are translatable (without concatenation, handles
    plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first
    approach
  • Code is tested on the minimum supported PHP and WordPress
    versions

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.

Course Outline: Add CSS class to lessons blocked by content dripping

1 participant