Categories Help and video uploads

How you can remove Categories: part you will need to add the code below at the bottom of your theme’s functions.php file: add_filter( ‘get_the_archive_title’, function ($title) { if ( is_category() ) { $title = single_cat_title( ”, false ); } return $title; }); And when it comes to uploading videos and plans you have to contact … 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

WP_Custom_Media_Control | Give ID to media file

The setting associated with the media control will have the ID for the attachment stored as its value. Assuming you have registered a setting for your control like this: $wp_customize->add_setting( ‘resume’, array( ‘type’ => ‘option’, // … ) ); Then you would obtain the attachment ID just by reading from the option, like: get_option( ‘resume’ … Read more

media_handle_upload fails with gravity form submitted image

That error is very probabbly due to incorrect loading of the required files from wp-admin; note how in your code those files are loaded only when a scpecific input has data (input_13) but not in every case you need those files. You do this: if( !empty($_FILES[‘input_13’][‘name’])) { require_once(ABSPATH . ‘wp-admin/includes/file.php’); require_once(ABSPATH . ‘wp-admin/includes/image.php’); // …. … Read more