Making WordPress.org


Ignore:
Timestamp:
07/27/2026 01:50:57 AM (6 weeks ago)
Author:
obenland
Message:

Learn: Sync with git WordPress/learn@09884af

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/views/block-course-status.php

    r13775 r15007  
    1616 */
    1717function render( $attributes, $content, $block ) {
    18         $post_type = $block->context['postType'];
     18        $post_type = $block->context['postType'] ?? '';
     19        $course_id = $block->context['postId'] ?? 0;
    1920
    20         if ( 'course' !== $post_type || ! class_exists( 'Sensei_Main' ) ) {
     21        if ( ! $course_id || 'course' !== $post_type || ! class_exists( 'Sensei_Main' ) ) {
    2122                return '';
    2223        }
    2324
    24         $course_id    = $block->context['postId'];
    2525        $user_id      = get_current_user_id();
    2626        $is_completed = Sensei_Utils::user_completed_course( $course_id, $user_id );
Note: See TracChangeset for help on using the changeset viewer.