What is a moderator? A custom user role? If yes, then:
add_action( 'init', 'blockusers_init' );
function blockusers_init() {
if ( is_admin() && (!current_user_can( 'administrator' ) || !current_user_can( 'moderator' ) ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_redirect( 'http://madeeasy-online.com/zhile-2/dobavit-obyavlenie/', 302);
exit;
}
}
Related Posts:
- Allow tags and attributes in post and pages content
- Solution to render Shortcodes in Admin Editor
- How to run a function every 5 minutes?
- Upload Multiple Files With media_handle_upload
- Add custom template page programmatically
- What is the difference between get_page_link and get_permalink functions?
- How to override admin-bar style
- Woocommerce add to simple product attribute programmatically [closed]
- WP 4.4. responsive loads normal image after loading the responsive image
- How can I tell if I’m on a login page? [duplicate]
- Get Category and Excerpt From wp_get_recent_posts
- mysql custom wp query
- TinyMCE custom stylesheets for different post types
- Order get_users() by last login date. Is it possible?
- Display random text from a file with the WP built-in AJAX API
- Error after editing functions.php
- How do I properly register bootstrap JavaScript into WordPress functions.php?
- Function to Download External Images to My Site
- Manipulate Output of wp_list_something: select menu instead of li’s
- How to call a function on particular page like ‘contact-us’ from function.php of child theme
- Detect Safari desktop browser and include the detection in a shortcode
- Is It wrong to use oop approach on functions.php?
- How to preserve edits to Name or Slug of term when using wp_update_term on save?
- how to fix Warning: Use of undefined constant _ – assumed ‘_’ (this will throw an Error in a future version of PHP)
- restore_current_blog required after switch_to_blog, if I use that in a function?
- ‘is’ functions and ‘get_query_var’ not working
- How Can I Expand the WordPress Customize window without any Plugin?
- “is_new_day()” alternative for years?
- How to hide a plugin metabox for non admins when a user adds a new post
- Getting Featured Image Caption to Only Show if Populated
- Where do I add html code to the menu div?
- How do I create page navigation linking to each H2 within the page? [closed]
- Add function to every post?
- Understanding and altering the structure of posted images
- Allow Post Author to be 0 on Update
- How do I hide or remove ‘Category’ from wordpress breadcrumbs
- Trouble with adding a wp_enqueue_script on wordpress
- admin-ajax.php + load-scripts.php hanging for minutes
- Display ‘BuddyPress Follow’ follow button to non-logged in users [closed]
- Show image exactly defined to a width
- wp-admin won’t load after setting wp-login custom url
- Get ID of first image attached to a post
- jQuery does not work
- Function naming convention
- Is `is_sidebar_active()` deprecated, and showing error?
- How to return hook data when multiple parameters are present?
- Generate featured images old posts
- debugging errors.. how to remedy?
- Where do i create my own function in wp-admin
- Use /prefix/postname as a slug in post_name?
- Send email to admin user when custom post type is created
- Pass variable from action back to template
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Test if a post exists by category and date
- Question about “wp_deregister_script()”
- Where to call my pagination function?
- How do I pull excerpts from pages?
- Output loop to function return?
- Combine embed_oembed_html and oembed_result
- Load JS file only in specific template
- Check if a value exists in database table
- Add element to widgetpage
- Using functions.php to include code that’s processed inline
- why can’t i add front.css to my frontpage.php
- “All posts” in the category widget
- Are innerHTML elements visible to jQuery functions?
- video.js not enqueueing?
- how to display a page before the home page
- Removing WPML Items From the WordPress Admin Bar
- This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
- Get webpack to work on child theme
- Override a Post’s URL with Advanced Custom Fields Function
- Passing function arguments via a shortcode
- Hide ‘add to cart’ when certain value in dropdown is selected
- Test CDN link from function.php or wp_enqueue_script/style?
- Help with with my function for wordpress
- Widget is displayed in two places
- Can site visitors view functions.php file?
- Wildcard 301 Redirect Using Theme Function
- Changing the default view of “The Events Calendar” for mobile
- Link to an externally created photo albums
- Hide empty custom field
- WordPress function with attribute pass to template
- How to identify author in wordpress comments?
- Which method is more correct for removing WooCommerce Extensions menu item?
- Why does Featured Images not load in the backed?
- Help! Need a different logo on my main page from my other pages
- RSS feed including post updates
- Javascript and Stylesheet in child page
- How to add number to wordpress count function?
- How do I integrate my Child Theme into a Custom Template?
- Why are some custom javascript files working but some are not
- Custom Nested WordPress Comments with avatar
- using enqueue_script in a shortcode isn’t working
- Functions file mods and CPU
- How to overwrite ‘read more” text for artmag theme
- How to display milliseconds instead of seconds using timer_stop function? [closed]
- Load script only on selected Pages
- Convert Image to Webp on upload without plugin
- How to automatically load Google Fonts on pages only as they’re used?