Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • This problem appears to have resolved itself. Reasons are still unknown.

    I’m having the same issue, and am also perplexed. .htaccess monkeying seemed to have no effect, nor did deactivating all of my plugins.

    Possibly relatedly, WP’s automatic upgrade didn’t fly at all, throwing an error when trying to unpack.

    Ah. Duhr.

    Sorry about that. Older code that I sorta fiddled with to make it fit the problem at hand.

    The trick is that you ALWAYS want user_can_richedit to be true. So I guess you could just have:
    add_filter('user_can_richedit', TRUE)
    or something to that effect.

    To keep the HTML editor for folks other than authors, you’d need to hack around that general_template.php some more, and wrap the commentary in some kind of if statement (if (current_eser_can('manage_option') { HTMLEDITORCODE } else { COMMENTEDOUTHTMLEDITORCODE }

    Grain of salt: I’m making this up as I go along, same as you. Forgive me my trespasses.

    Which piece wasn’t working?

    To hide the HTML option, my suggestion was commenting out line 923 in general_template.php. Did that not go for you?

    I wish I could see a pluggable solution for that, but there aren’t any hooks in that area that I can find. ??

    Mwahaha.

    I love it when I kinda solve my own problem. But this answers part of yours (I think) so hooray for both of us.

    //Remove media upload area
    function curb_uploads($initcontext)
    {
    	if ( ! current_user_can('manage_options') ) {
    		$initcontext = 'No Uploads';
    	}
    	return $initcontext;
    }
    add_filter('media_buttons_context', 'curb_uploads');

    Oh, and the media buttons (which aren’t the same as the answer I just gave, because you kinda asked two questions): in the aformentioned function, $media_buttons is one of the arguments, defaulted to true (and not explicitly set when called by edit-form-advanced.php). Set it to false somewhere, either in the call, or in the argument list, or early in the code, and the media upload buttons will go away.

    Again, a pluggable solution is welcome, if someone knows one.

    I can help solve your problem. So near as I can tell, it’s a hack though, and not a pluggable solution.

    \wp-includes\general_template.php, at line 921, is where the editor lives. If you wanted to yank HTML ability, you’d comment out line 933:
    <a id="edButtonHTML" onclick="switchEditors.go('<?php echo $id; ?>');"><?php _e('HTML'); ?></a>

    If you wanted HTML only, you could comment out 938:
    <a id="edButtonPreview" onclick="switchEditors.go('<?php echo $id; ?>');"><?php _e('Visual'); ?></a>

    In either instance, I’d suggest something to inhibit their ability to choose in their profiles. Something like the following (which *IS* pluggable):

    //Disallow HTML editing
    function strip_htmleditor($origvalue)
    {
    	return !(current_user_can('edit_published_posts'));
    }
    add_filter('user_can_richedit', 'strip_htmleditor');

    If there exists a pluggable solution to your problem, I’d love to hear it, since I’m trying to customize a site rather similarly at present.

    I am experiencing the same problem, and would love to know if others are having the same issue.

    Interestingly, the problem seems to be intermittent; it appeared today for about 15 minutes, was fine for most of the day, and has reappeared now (as of the time of this reply).

Viewing 8 replies - 1 through 8 (of 8 total)