'.__('Settings').''; } return $links; } add_filter( 'plugin_action_links', '__advsettings_plugin_action_links', 10, 2 ); $configs = get_option('powerconfigs'); #print_r($configs); # Remove admin menu if( $configs['remove_menu'] ) add_filter('show_admin_bar' , '__return_false'); // Remove admin menu # Remove header generator if( $configs['remove_generator'] ) remove_action('wp_head', 'wp_generator'); # Remove WLW if( $configs['remove_wlw'] ) remove_action('wp_head', 'wlwmanifest_link'); # Remove update message from admin if( $configs['remove_update_msg'] ) { null; } # Thumbnails support if( $configs['add_thumbs'] ) add_theme_support( 'post-thumbnails' ); # JPEG Quality if( $configs['jpeg_quality'] && $_SERVER['HTTP_HOST']!='localhost' ) { add_filter('jpeg_quality', '____jpeg_quality'); function ____jpeg_quality(){ $configs = get_option('powerconfigs'); return $configs['jpeg_quality']; } } # REL External if( $configs['rel_external'] ) { function ____replace_targets( $content ) { $content = str_replace('target="_self"', '', $content); return str_replace('target="_blank"', 'rel="external"', $content); } add_filter( 'the_content', '____replace_targets' ); } # REL External if( $configs['post_type_pag'] ) { # following are code adapted from Custom Post Type Category Pagination Fix by jdantzer function fix_category_pagination($qs){ if(isset($qs['category_name']) && isset($qs['paged'])){ $qs['post_type'] = get_post_types($args = array( 'public' => true, '_builtin' => false )); array_push($qs['post_type'],'post'); } return $qs; } add_filter('request', 'fix_category_pagination'); } # Filtering the code if( $configs['compress'] || $configs['remove_comments'] ) { add_action('template_redirect','____template'); function ____template() { ob_start('____template2'); } function ____template2($code) { $configs = get_option('powerconfigs'); if( $configs['remove_comments'] ) $code = preg_replace('//', '', $code); if( $configs['compress'] ) $code = trim( preg_replace( '/\s+/', ' ', $code ) ); /* Acentos */ #$code = str_encode( $code ); return $code; } } # Google Analytics if( $configs['analytics'] ) { add_action('wp_footer', '____analytics'); // Load custom styles function ____analytics(){ $configs = get_option('powerconfigs'); echo ''; } } # Remove admin menu - FIX: IF IS ADMIN USER if( $configs['show_query_num'] ) { function __show_sql_query_num(){ global $wpdb; $content = '