Making WordPress.org


Ignore:
Timestamp:
04/01/2021 09:01:06 PM (5 years ago)
Author:
iandunn
Message:

Learn Plugin: Sync with Git.

File:
1 edited

Legend:

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

    r10461 r10866  
    6666function register_workshop_meta() {
    6767    $post_type = 'wporg_workshop';
     68
     69    register_post_meta(
     70        $post_type,
     71        'video_url',
     72        array(
     73            'description'       => __( "The URL of the Workshop's video.", 'wporg_learn' ),
     74            'type'              => 'string',
     75            'single'            => true,
     76            'sanitize_callback' => 'esc_url_raw',
     77            'show_in_rest'      => true,
     78        )
     79    );
    6880
    6981    register_post_meta(
     
    377389    }
    378390
     391    $video_url = filter_input( INPUT_POST, 'video-url', FILTER_SANITIZE_URL );
     392    update_post_meta( $post_id, 'video_url', $video_url );
     393
    379394    $duration = filter_input( INPUT_POST, 'duration', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY );
    380395    if ( isset( $duration['h'], $duration['m'], $duration['s'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.