Created
December 7, 2023 07:39
-
-
Save wbcomdev/256bb1103e5985184b7c81b547d26ebe to your computer and use it in GitHub Desktop.
Restrict instructors to upload course images of particular sizes while creating new courses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'ld_dashboard_course_form_fields', function( $fields ) { | |
| if( ! empty( $fields ) ) { //First we check fields are not empty | |
| foreach ( $fields as $key => $field ) { | |
| if( 'field_61fcef414383d' === $fields[$key]['key'] ){ | |
| $fields[$key]['max_width'] = 600; //Provide the value of maximum with of image that would be uploaded by instructor | |
| $fields[$key]['max_height'] = 600; //Provide the value of maximum height of image that would be uploaded by instructor | |
| $fields[$key]['max_size'] = 600; //Provide the value of size of image that would be uploaded by instructor | |
| } | |
| } | |
| } | |
| return $fields; | |
| } ); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment