Making WordPress.org


Ignore:
Timestamp:
11/23/2020 09:41:51 PM (4 years ago)
Author:
coreymckrill
Message:

WordPress.org Learn: Sync with GitHub

https://github.com/WordPress/learn/compare/2c9bbc5fc4eefb1f1a367f7bb8afcd3da6ef32b0...886286a12b9802be8d34715149f55ddf67832432

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-meta.php

    r10458 r10461  
    112112            'single'            => false,
    113113            'sanitize_callback' => __NAMESPACE__ . '\sanitize_locale',
     114            'show_in_rest'      => true,
     115        )
     116    );
     117
     118    register_post_meta(
     119        $post_type,
     120        'linked_lesson_id',
     121        array(
     122            'description'       => __( 'The post ID of a lesson that covers this workshop.', 'wporg_learn' ),
     123            'type'              => 'integer',
     124            'single'            => true,
     125            'sanitize_callback' => 'absint',
    114126            'show_in_rest'      => true,
    115127        )
     
    312324    $locales           = get_locales_with_english_names();
    313325    $captions          = get_post_meta( $post->ID, 'video_caption_language' ) ?: array();
     326    $all_lessons       = get_posts( array(
     327        'post_type'      => 'lesson',
     328        'post_status'    => 'publish',
     329        'posts_per_page' => 999,
     330        'orderby'        => 'title',
     331        'order'          => 'asc',
     332    ) );
    314333
    315334    require get_views_path() . 'metabox-workshop-details.php';
     
    374393        }
    375394    }
     395
     396    $lesson_id = filter_input( INPUT_POST, 'linked-lesson-id', FILTER_SANITIZE_NUMBER_INT );
     397    update_post_meta( $post_id, 'linked_lesson_id', $lesson_id );
    376398
    377399    $presenter_wporg_username = filter_input( INPUT_POST, 'presenter-wporg-username' );
Note: See TracChangeset for help on using the changeset viewer.