• Resolved Earl_D

    (@earl_d)


    Is there a way to restrict the upload video options on the form to embed and video URL?
    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Farook Ibrahim

    (@farookibrahim)

    Hello @earl_d,

    You can try below code to disable “Upload Video” option from video choice.

    
    if( ! function_exists( 'your_theme_child_masvideos_upload_video_fields' ) ) {
        function your_theme_child_masvideos_upload_video_fields( $fields ) {
            if( isset( $fields['video_choice'] ) ) {
                $fields['video_choice'] = array(
                    'type'         => 'select',
                    'options'      => array(
                        'video_embed'   => __( 'Embed Video', 'masvideos' ),
                        'video_url'     => __( 'Video URL', 'masvideos' ),
                    ),
                    'label'        => __( 'Video Method', 'masvideos' ),
                    'required'     => false,
                    'class'        => array( 'form-row-video_choice' ),
                    'priority'     => 60,
                );
    
                if( isset( $fields['video_attachment_id'] ) ) {
                    unset( $fields['video_attachment_id'] );
                }
            }
    
            return $fields;
        }
    }
    
    add_filter( 'masvideos_upload_video_fields', 'your_theme_child_masvideos_upload_video_fields' );
    

    Regards

    Thread Starter Earl_D

    (@earl_d)

    Put it in the functions.php of my child theme nothing changed

    Plugin Author Farook Ibrahim

    (@farookibrahim)

    Hello @earl_d,

    I tested again the code and it works fine.

    Regards

    Thread Starter Earl_D

    (@earl_d)

    Ok can you give some more information. Ex should the syntax my_child_theme be replaced with my actual child theme name?

    Thread Starter Earl_D

    (@earl_d)

    Apologies apparently the functions file wasn’t getting updated once I figured that and edits outside of WP admin it worked thanks for the help.

    Plugin Author MadrasThemes

    (@madrasthemes)

    Glad your issue is resolved. Please do not hesitate to reach us if you have any other questions related to our plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Upload video options’ is closed to new replies.