Exemplo n.º 1
0
function wccp_main_settings()
{
    global $wccp_settings;
    if (!current_user_can('manage_options') || current_user_can('manage_options') && $wccp_settings['exclude_admin_from_protection'] == 'No') {
        if ((is_home() || is_front_page() || is_archive() || is_post_type_archive() || is_404() || is_attachment() || is_author() || is_category() || is_feed() || is_search()) && $wccp_settings['home_page_protection'] == 'Enabled') {
            wpcp_disable_selection();
            return;
        }
        if (is_single() && $wccp_settings['single_posts_protection'] == 'Enabled') {
            wpcp_disable_selection();
            return;
        }
        if (is_page() && !is_front_page() && $wccp_settings['page_protection'] == 'Enabled') {
            wpcp_disable_selection();
            return;
        }
    }
}
Exemplo n.º 2
0
function wccp_main_settings()
{
    global $wccp_settings;
    if (!is_user_logged_in() || is_user_logged_in() && $wccp_settings['exclude_admin_from_protection'] == 'No') {
        if ((is_home() || is_front_page()) && $wccp_settings['home_page_protection'] == 'Enabled') {
            wpcp_disable_selection();
            return;
        }
        if (is_single() && $wccp_settings['single_posts_protection'] == 'Enabled') {
            wpcp_disable_selection();
            return;
        }
        if (is_page() && !is_front_page() && $wccp_settings['page_protection'] == 'Enabled') {
            wpcp_disable_selection();
            return;
        }
    }
}