Admin menu disable new/delete page
If achieving this with a plugin is acceptable to you, an answer to a similar question recommended the Advanced Access Manager plugin.
If achieving this with a plugin is acceptable to you, an answer to a similar question recommended the Advanced Access Manager plugin.
WordPress has a fairly good roles and capabilities system already and, IMHO, you’d find it easier working with that. When the admin menu is constructed, every item on the admin menu is subject to a check on a relevant capability. Similarly every attempt to use an admin screen is checked. It’s possible to use map_meta_cap … Read more
The WordPress admin area uses capabilities to determine which user role can see what pages etc. You can use custom written code or several plugins to control to capabilities by each user. I’d suggest using the Members plugin for some easy control.
Have a look at the Network Admin Settings screen (in my installation, it’s at example.com/wp-admin/network/settings.php). Tucked away down near the bottom is this: Menu Settings Enable administration menus [] Plugins Checking that box should allow your users to see the Plugins menu in their sites’ back end. (I don’t think it’ll allow them to install … Read more
Turns out that it is possible to run a WP_Query inside a pre_get_posts action keeping in mind two simple principles: pre_get_posts action will alter every query that you make, so you need to contain its action specifying which queries you need to alter. In this case, this containment is done with this line: if ( … Read more
It is enough to add unfiltered_html capability to Editor role. Add the following code into your current theme’s functions.php: function wpse_change_capability() { $role = get_role( ‘editor’ ); if ( ! $role->has_cap( ‘unfiltered_html’ ) ) $role->add_cap( ‘unfiltered_html’ ); } add_action( ‘init’, ‘wpse_change_capability’, 10 ); Login as the user with Editor role. Test it by editing any … Read more
You can use this for a custom stylesheet. Copy and paste all the CSS from the original thickbox.css in your custom stylesheet. Now you can edit your custom CSS and add the code below in your plugin. function get_thickbox() { // Add the original thickbox add_thickbox(); // register your custom stylesheet // Make sure its … Read more
Custom redirection when managing users in admin
You have a script active that prevents normal behaviour of links if they have no target=”_blank” attribute on them. The original site has this attribute on the link to the blog, so that one works. The ‘new’ site doesn’t have it on the menu links, so those links are disabled. To fix this, go to … Read more
To return a blank page that’s been created in a plugin like so: Example: blank-page.php <?php // Blank PHP page… Use the following function: add_filter( ‘some_tag’, ‘wpse_238008_blank_page’, 99 ); function wpse_238008_blank_page() { // Template with an empty page define( ‘PLUGIN_PATH’, plugin_dir_path( __FILE__ ) ); return PLUGIN_PATH . ‘/path/to/blank-page.php’; } Replace the following to suit your … Read more