Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter averyl

    (@averyl)

    That’s still not working for me… So I use this instead:

    set_user_setting('urlbutton', 'file' );
    set_user_setting('imgsize', 'large' );
    set_user_setting('image_default_link_type', 'file' );
    set_user_setting('align', 'none' );
    Thread Starter averyl

    (@averyl)

    Thanks a lot for your reply!

    It’s no problem if the emails are spread over time, I just need to be sure Mandrill gets them all if 200 emails or more are sent it a second. I realise this might not be a large amount of emails for Mandrill, it just sounds like a lot to me! ??

    Thanks again!

    Thread Starter averyl

    (@averyl)

    set_user_setting('urlbutton', 'file' );

    sets links the attachment to the file by default. But the author can still change it to the attachment page.

    function gg_attachment_redirect() {
    	global $post;
    	if (is_attachment()) {
    		wp_redirect(wp_get_attachment_url( $post->ID ), 301);
    	exit;
    	}
    }
    add_action('template_redirect', 'gg_attachment_redirect', 1);

    only redirects all the attachment pages to the file, even if it was set to attachment page.

    You just add this code to your functions.php. I’m not sure if it would be useful to do his only for a specific group since you can change the default setting anyway and if you redirect, your setting won’t make any difference.

    Thread Starter averyl

    (@averyl)

    Hmm, the only way to do it is

    .attachment-display-settings .alignment {
    	display: none;
    }

    but then the label’s still there. Of course it prevents people from setting it differently, but it’s not the cleanest solution.

    Thread Starter averyl

    (@averyl)

    It does? Just add

    .attachment-display-settings {
    	display: none;
    }

    to your admin.css or whatever you called it.

    Thread Starter averyl

    (@averyl)

    You can remove these buttons if you create a custom admin.css and add the following:

    #content_justifyleft,
    #content_justifyright,
    #content_justifycenter,
    #content_justifyfull {
    	display: none;
    }

    To have even more control, add this to function.php:

    function custom_tinymce_options($initArray){
     	$initArray['theme_advanced_buttons1'] = 'styleselect,bold,italic,strikethrough,underline,|,bullist,numlist,blockquote,hr,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,spellchecker';
     	$initArray['theme_advanced_buttons2'] = 'formatselect,forecolor,|,pastetext,pasteword,removeformat,|,charmap,sub,sup,|,outdent,indent,|,undo,redo';
     	return $initArray;
    }
    add_filter('tiny_mce_before_init', 'custom_tinymce_options');

    Then remove the buttons you don’t want! ??

    Thread Starter averyl

    (@averyl)

    Oh and if you need all the images to be aligned the same, just don’t add any css. People will still be able to set the alignment, but it won’t do anything. Maybe override the editor-style css.css as well so people see that it doesn’t work before they post.
    Image default size should also be doable with css, though you keep the original size then. That’s a problem for for really big images… There are a lot of plugins to resize the image before upload.

    Of course, these options were really useful, so I hope we see them again in the next version. I also hope there will be an option to totally disable the attachment pages, because quite al lot of people don’t seem to use them.

    Thread Starter averyl

    (@averyl)

    For me the solution Andrew gave works. It sets the option to the media file as default, but it doesn’t remove any attachment pages from older post. I don’t think totally disabling them is possible, but you might want to redirect them all. I use this:

    set_user_setting('urlbutton', 'file' );
    function gg_attachment_redirect() {
    	global $post;
    	if (is_attachment()) {
    		wp_redirect(wp_get_attachment_url( $post->ID ), 301);
    	exit;
    	}
    }
    add_action('template_redirect', 'gg_attachment_redirect', 1);

    However, this won’t be a good solution if you need a direct link to the file, like for Fancybox for example.

    Thread Starter averyl

    (@averyl)

    Oh, ok. It was useful to have it there though.

    Thread Starter averyl

    (@averyl)

    That works great, thanks!
    I know it just sets a default, but it would be even more interesting if there was an option to totally disable attachment pages. Now I’m redirecting them all to the files.
    But thanks, this is what I was looking for!

    Thread Starter averyl

    (@averyl)

    It just logs you out. So you can’t log in again unless you manually insert a new user in the db. I didn’t check if the post/postmeta was reset.
    That’s ok, thanks for your quick reply.

    Thread Starter averyl

    (@averyl)

    Ok, I just realised I’m running 3.5 RC3… Yes, I’m sure I didn’t select that.

    Thread Starter averyl

    (@averyl)

    Thanks, I’m glad I’ve been of some help then.
    Kind of annoying though, I’ll try to force it with js or I’ll add a warning to our back end when we update to 3.5.
    If there’s anyone who knows something that totally disables attachment pages (also the drop down?), please let me know ??

    Thread Starter averyl

    (@averyl)

    Thanks!

    Thread Starter averyl

    (@averyl)

    Yeah it works in 3.4.2. Is there any way to disable attachment pages in 3.5 or in general and link straight to the file without a redirect?

Viewing 15 replies - 1 through 15 (of 16 total)