'POST', 'callback' => 'stackable_welcome_video_closed_callback', 'permission_callback' => function () { return current_user_can( 'edit_posts' ); } ) ); } add_action( 'rest_api_init', 'stackable_welcome_video_closed_endpoint' ); } if ( ! function_exists( 'stackable_display_welcome_video' ) ) { /** * Check whether we need to display the welcome video for the user. * * @return Boolean True if the welcome video should be shown. */ function stackable_display_welcome_video() { if ( ! current_user_can( 'edit_posts' ) ) { return false; } return ! get_user_meta( get_current_user_id(), 'stackable_welcome_video_closed', true ); } }