Is there a way to limit multi upload in media upload box?

This is a bit out of context but I think you can approach it a little bit differently, you can limit access to default media library for roles below “admin” or “editor” depending on your setup. For instance you can block authors from uploading files to media library using the following code.. if ( current_user_can(‘author’) … Read more

Video limit about wordpress

there is no limit to how much video you can upload, apart from disk space on the server. There is also a limit on how big each file can be according to your PHP configuration, but on on the combined size of all the videos. Your challenges in this project will be preparing the videos … Read more

How to restrict type/size of file uploads in any plugin?

You use upload_mimes filter to restrict the image type as : add_filter(‘upload_mimes’,’restict_image_type’); function restict_image_type($mimes) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘gif’ => ‘image/gif’, ‘png’ => ‘image/png’, ); return $mimes; } For upload limit you can set in .htaccess one of the following; LimitRequestBody 1048576 //( 1MB) php_value upload_max_filesize 1M php_value post_max_size 1M

Balance Tags to the_content Words Length

You better call it before returning, inside technig_content() so that it’s return value is always balanced. So, the last two lines of your function would become: $content = str_replace(‘]]>’, ‘]]>’, $content); $content = balanceTags( $content ); return $content; Having said that, I don’t think it’s a good way of handling your output, since you don’t … Read more

If user has 1 post then dont let him create new one [closed]

You can use count_user_posts function. If the posts are getting saved as WordPress posts then it can be done by the snippet below: if (is_user_logged_in()){ $userPostCount = count_user_posts(get_current_user_id()); if ($userPostCount > 1){ $user = new WP_User(get_current_user_id()); $user->add_cap(‘publish_posts’,false); } else { $user->add_cap(‘publish_posts’,true); } }

Limit post top level categories to one

Late answer but I figured I’d throw in my idea since I had a similar problem recently. Basically I did this by injecting a script into the editor views. My function looked something like this: (function() { var o=function() { //add a click handler to category checkboxes jQuery(“#categorychecklist input”).click(function() { //get top-level category (in case … Read more

WPAdverts – How to limit form submission 10 per month

You can do it using get_user_meta and update_user_meta: $value = get_user_meta($user_id, ‘form_submission’, true); if (!$value) {$value = 1;} else {$value = $value + 1;} if ($value < 11) { update_user_meta($user_id, ‘form_submission’, $value); } else { // too many form submissions } You could also expand on this to store the submission month too if you … Read more