The MU forums have moved to WordPress.org

Shut off Advanced Edit (10 posts)

  1. realsol
    Member
    Posted 15 years ago #

    I have Advanced Edit set to 0 in my blog opitions, though any new user automatically has 'Visual Editor' checked in their profile. How do I make it so each new user will have that shut off automatically until I turn it on.

    thanks.

  2. tdjcbe
    Member
    Posted 15 years ago #

    Let's try this again.

    - Take a look at wp-includes/registration.php.

    - Look for the function wp_insert_user().

    - Look for this code:

    if ( empty($rich_editing) )
    		$rich_editing = 'true';

    Should be lines 154-155.

    - Change it to 'false' and save.

    Probably could do it as a plugin but it would load each and every time. This is quicker and easier to do. You'll ust have to make the edit when you replace the file.

    Hope this helps.

  3. realsol
    Member
    Posted 15 years ago #

    Thanks for the post.

    What I need it to do is to have it as a per blog setting.

    I want users in my personal blog not to be able to use it, accept for me, the admin. There might be other blogs downl the road which might want this also.

    Can't figure out how to do it per blog.

    Thanks.

  4. andrea_r
    Moderator
    Posted 15 years ago #

    It's stored as a checkbox on the user's profile page, if that helps.

  5. realsol
    Member
    Posted 15 years ago #

    Thanks andrea_r.

    But, when I shut it off their, it shuts it off globally. They can no longer use advance on their blog.

    Maybe I should explain. I created a plug-in that format's the view of a post in my recipe category to format ingredients and display a certain way. To do this, I created a form for users to post their recipes and I post it to the database. To keep users from messing up the formatting of the post, I was going to created an edit link on the page and display it if it is their recipe. I then send the post content to the form for editing, thus leaving them out of the admin area.

    Everything was done, but the form was being populated with
    's and /'s and stuff that I didn't want the user to see. Not sure how to strip these out prior to loading the form easily. Any help here would be great?!

    So, I decided if they want to edit it, I will let them in the admin area, but with the advanced editor, it is too easy for my format to get messed up, adding extra <p>'s and things. So, I thought with the HTML editor, it would be easier.

    Anyhow, spent a lot of time on the plug-in. Scales the recipe ingredients, direction and servings, but just looking for an easy way for user's to add and edit it without them messing up the format.

    I know this is an off the wall posing, but who knows, could benefit someone down the road. Any help would be great.

  6. dsader
    Member
    Posted 15 years ago #

    I think the following example disables richeditor for all but the SiteAdmin at blog 66 and leaves richeditor setting untouched for everyone/everywhere else.
    <?php
    function ds_no_visual_editor($wp_rich_edit) {
    global $blog_id;
    if( !is_site_admin() && $blog_id == '66' ) {
    $wp_rich_edit = 'false';
    } else {
    return $wp_rich_edit;
    }
    }
    add_filter('user_can_richedit', 'ds_no_visual_editor');
    ?>

    You could verify that this much works and add a foreach loop for multiple blogs later.

  7. realsol
    Member
    Posted 15 years ago #

    Thanks, I will give it a shot.

  8. realsol
    Member
    Posted 15 years ago #

    Thanks. worked great, although I still want to use the form I created, but when I populate the fields from the content, I get all of the html code that is stored in the content posted to the form, like the breaks and the paragraph tags.

    Do you know how I can populate multi-line edit box in a form, but convert the breaks and paragraph tags to line feeds?

    The form is now being created in the same PHP file code that grabs the post contents. I'm just putting the contents in a variable and setting the initial text to it.

    Any ideas?

    Thanks again. You code work perfect, though I would like to keep them out of the admin all together.

  9. dsader
    Member
    Posted 15 years ago #

    The issue may be if using get_the_content (no filters) versus the_content filtered:

    http://mu.wordpress.org/forums/topic.php?id=9973#post-60049

  10. realsol
    Member
    Posted 15 years ago #

    Hey, this thread kinda got off tract. I guess you are answering the same questions here: http://mu.wordpress.org/forums/topic.php?id=9973&replies=1#post-59909.

    Thanks. Still unanswered though.

About this Topic