WordPress.org

Ready to get started?Download WordPress

Forums

wordpress functions (2 posts)

  1. cook44j
    Member
    Posted 1 year ago #

    I dont know much about functions please forgive my inexperience. I have these functions added to my functions.php file on a hosted wordpress site. They work on my admin user account and on a test user account, but not on other user accounts. Below are the functions. Any help is appreciated.

    add_action('screen_options_show_screen','remove_screen_options',13);
    function remove_screen_options(){ return false;}
    if(!current_user_can('contributor','author','editor','edit_others_posts'))
    add_action('after_setup_theme','remove_post_formats',11);
    function remove_post_formats() {
    remove_theme_support('post-formats');}
    add_action('after_setup_theme','remove_post_thumbnails',14);
    function remove_post_thumbnails() {
    remove_theme_support('post-thumbnails');}

  2. WebTechGlobal
    Member
    Posted 1 year ago #

    This line is not for subscribers...

    if(!current_user_can('contributor','author','editor','edit_others_posts'))

    Did you test with a user account set to Editor or Author or Contributor?

    Is it possible your test account is administrator and your other accounts are subscribers?

    It is suitable for administrator due to "edit_others_posts".

Topic Closed

This topic has been closed to new replies.

About this Topic