Upload media file problem

I’d suggest asking your client what value is shown when adding media, as shown here in the screenshot. If the value shown is 1mb then i can tell you the function responsible is the following. function wp_max_upload_size() { $u_bytes = wp_convert_hr_to_bytes( ini_get( ‘upload_max_filesize’ ) ); $p_bytes = wp_convert_hr_to_bytes( ini_get( ‘post_max_size’ ) ); $bytes = apply_filters( … Read more

Select image sizes you want to be uploaded

If I am not mistaken, WordPress just creates these sizes. The only thing you can say is which image you want to pick of these sizes. You can use this piece of code to make the sizes appear inside of the dropdown. Make sure to place this inside the functions.php after adding the image_sizes. function … Read more

Intercept request to /wp-content/uploads/random.file

I just ran a test where I uploaded an image to media library, then renamed my root index.php file to break WordPress, but the image I uploaded was still available by accessing it directly with its wp-content/uploads/… URL. There are no .htaccess files in wp-content or uploads either, which means that, barring any plugins that … Read more

Gravity Forms – Repeatable “File Upload” field using “gform_column_input_content” filter [closed]

The following provides you with a file upload: add_filter(“gform_column_input_content_21_9_3”, “change_column3_content”, 10, 6); function change_column3_content($input, $input_info, $field, $text, $value, $form_id) { $input_field_name=”input_” . $field[“id”] . ‘[]’; $tabindex = GFCommon::get_tabindex(); $new_input=”<input type=”file” name=”” . $input_field_name . ‘” ‘ . $tabindex . ‘ class=”YOUR-CSS-CLASSES” />’; return $new_input; } But what does ‘repeatable’ mean in this context? Do you … Read more

Use Media Uploader in Plugin

Try using this code: define(“ME_URL”, rtrim(WP_PLUGIN_URL,”https://wordpress.stackexchange.com/”) . “https://wordpress.stackexchange.com/” . basename(dirname(__FILE__))); define(“ME_DIR”, rtrim(dirname(__FILE__), “https://wordpress.stackexchange.com/”)); function my_admin_scripts() { wp_enqueue_script(‘media-upload’); wp_enqueue_script(‘thickbox’); } function my_admin_styles() { wp_enqueue_style(‘thickbox’); } add_action(‘admin_print_scripts’, ‘my_admin_scripts’); add_action(‘admin_print_styles’, ‘my_admin_styles’); <td> <img src=”<?php echo esc_attr( get_the_author_meta( ‘profileimage’, $user->ID ) ); ?>” id=”ppimage”> <input type=”text” name=”profileimage” id=”profileimagetxt” value=”<?php echo esc_attr( get_the_author_meta( ‘profileimage’, $user->ID ) ); ?>” class=”regular-text” /><br … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)