Custom icons in media library
Custom icons in media library
Custom icons in media library
Is it possible to change ‘Link to’ in all images in all articles?
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
Multiple media uploader buttons target only one input on the same page
There was a typo, and instead of: wp.media.view.Attachment.prototype.template = wp.media.template( ‘attachment-custom’ ); Should be: wp.media.view.Attachment.prototype.template = wp.media.template( ‘attachment_custom’ );
Oh, well, while writing the question I tried to copy the full link that takes the ajax call: example.com/wp-admin/async-upload.php and noticed that for the subscibers it was taking the user to their account page while the admins where getting The link you followed has expired. Notice on the screen. And then I got the ‘Aha’ … Read more
move_uploaded_file() not working on wordpress front end
You just create a folder called videos/and any subfolders/ inside your cpanel public_html directory then move the video from from the wordpress upload folder to the newly created videos folder or any sub directory you want to put it inside the videos folder. and thats it
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
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