Can’t edit media details in new role

As mentioned in my comment(s), below the code as it imho should be.(tested and working) /** * Add new role: Writer * This role allows to: Add/Edit/Delete Posts and Uploads * * Read more: {@link https://codex.wordpress.org/Roles_and_Capabilities} * * Works with @version WP4.8.1 and below */ add_role( ‘writer’, ‘Writer’, array( ‘delete_posts’ => true, ‘delete_published_posts’ => true, … Read more

Can’t access ‘Store uploads in this folder’

This is a very good question. The answer to the referenced post requires a change to the WP options. They are stored in the database in the wp_options table (assuming wp_ is your prefix). There are a few ways to change these in this case: Direct DB access: if you’re comfortable modifying the WP DB … Read more

How to make programmatic image upload generate thumbnail and sizes?

In order for wp_generate_attachment_metadata() to work properly in that it creates a thumbnail and other intermediate/image sizes like medium and large, the image attachment/post data must have the proper MIME type (post_mime_type), and despite you did set it in your $attachment array (the post data), there’s a problem with this part in your code: $wp_filetype … Read more

Add media column to edit post screen

you can create a column of post_thumbnail like so: // ADDING THUMBNAIL TO EDIT SCREEN if ( !function_exists(‘fb_AddThumbColumn’) && function_exists(‘add_theme_support’) ) { // for post and page add_theme_support(‘post-thumbnails’, array( ‘post’, ‘page’ ) ); function fb_AddThumbColumn($cols) { $cols[‘thumbnail’] = __(‘Thumbnail’); return $cols; } function fb_AddThumbValue($column_name, $post_id) { $width = (int) 100; $height = (int) 100; if … Read more

Setting higher upload limit

add this to your .htaccess file in the root of WordPress installation directory: php_value upload_max_filesize 20M php_value post_max_size 20M and you can change 20 to whatever you want, unless your hosting server is limiting it it should work just fine. Update: Create the php.ini File and add the Following: memory_limit = 20M upload_max_filesize = 192M … Read more