Disable HTML (Text) Tab in Post Editor

I was hunting for a way to do this, and no-one seems to mention the wp_editor_settings filter. This worked for me: function my_editor_settings($settings) { $settings[‘quicktags’] = false; return $settings; } add_filter(‘wp_editor_settings’, ‘my_editor_settings’);

How can I restore admin capabilities?

The string below actually represents an array in serialized form. a:1:{s:13:”administrator”;s:1:”1″;} Here: a:1 means an array with a single element s:13 means string and the length of the string followed by Array { “administrator” => “1” } Once that is in the table, you can use the unserialize() function to return it to an array … Read more

Help with shortcode in admin-ajax [closed]

How you are applying a filter is wrong. You need to bind a function to the filter, but you are providing a variable. function my_filter( $content ) { return $content . ‘My added code’; } add_filter( ‘the_content’, ‘my_filter’ ); You should add the code like this, this should work.

Hide upload image fields for the different media upload popups

I’m familiar with attachment_fields_to_edit and don’t recall ever seeing anything on being able to do modification as granular as you’re suggesting. There’s a WP global $screen (or is it $screens) that perhaps might help but I’m not too sure. Have you considered – as hacky as it might sound – doing these things with CSS … Read more

Restrict Admin Capabilities in MultiSite

Editing super admin capabilities is a little different from editing the capabilities of every other role, because there is a slight detour in the way WP checks the current user’s capabilities. This is what you find on capabilities.php on line 864: function has_cap( $cap ) { // (…) // Multisite super admin has all caps … Read more