It is possible to add custom media size in admin media edit?

add_image_size( ‘medium-something’, 480, 480 ); // Register the useful image size for use in Add Media modal add_filter( ‘image_size_names_choose’, ‘your_custom_sizes’ ); function your_custom_sizes( $sizes ) { return array_merge( $sizes, array( ‘medium-something’ => __( ‘Medium Something’ ), ) ); } Be aware that if the size does not already exist for an image, it will not … Read more

How to change image atributes right before an image to be saved?

If the import function you’re using uses wp_insert_post() (used also by wp_insert_attachment()) to add the new images (attachment posts) to your site, then you could perhaps use the wp_insert_attachment_data( array $data, array $postarr ) filter, which is defined inside wp_insert_post(). According to the docs it, Filters attachment post data before it is updated in or … Read more

Enabling users to upload files

I have added this code to enable everyone to add files function allow_own_attachments( $user_caps, $req_caps, $args, $UserObj ) { if ( empty($args[2]) ) { return $user_caps; // nothing to check } $post = get_post( $args[2] ); // post_id was passed here if (is_object($post)){ //check if $post is an object. If it is’t checked the code … Read more

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