Feature image *required*
-
How to make feature Image Required
-
Is there a way to use the tiny rich text area without the add media function
Hello
In the wpuf-add-post.php
SEARCH
//validate cat if ( wpuf_get_option( 'allow_cats', 'wpuf_frontend_posting', 'on' ) == 'on' ) { $cat_type = wpuf_get_option( 'cat_type', 'wpuf_frontend_posting', 'normal' ); if ( !isset( $_POST['category'] ) ) { $errors[] = __( 'Bitte wähle mindestens eine Kategorie!', 'wpuf' ); } else if ( $cat_type == 'normal' && $_POST['category'][0] == '-1' ) { $errors[] = __( 'Bitte wähle mindestens eine Kategorie!', 'wpuf' ); } else { if ( count( $_POST['category'] ) < 1 ) { $errors[] = __( 'Bitte wähle mindestens eine Kategorie!', 'wpuf' ); } } }After Add
//Begin Require an featured image upload function my_featured_image_validation($errors) { if ( empty($_POST['wpuf_featured_img']) ) { $errors[] = __( 'Please upload a Image', 'wpuf' ); } return $errors; } add_filter( 'wpuf_add_post_validation', 'my_featured_image_validation'); //End Require an featured image uploadSEARCH
<div id="wpuf-ft-upload-container">BEVOR ADD
<span class="required">*</span></label>it required users from posting without but it also showed a lot of code on the screen once user tried to upload with the image. how to correct that issue
It stopped users from posting without adding a feature image but it also shows a lot of code on the page if the user tried submitting without posting a image. how to fix that?
Hello
it required users from posting without but it also showed a lot of code on the screen once user tried to upload with the image. how to correct that issue
SEARCH in wpuf-add-post.php
function submit_post() { global $userdata; $errors = array(); var_dump( $_POST );REPLACE WITH
function submit_post() { global $userdata; $errors = array(); //var_dump( $_POST );hey bro sry for the super late reply but i just did as you instructed
and it work you are awesome capital A
hey sorry for the super late reply but i just did what your instructed and it worked youre awesome capital A
Even easier: Under custom CSS codes add the following:
.wp-media-buttons { display: none !important; }
The topic ‘Feature image *required*’ is closed to new replies.