'.__('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( isset($configs['remove_menu']) ) add_filter('show_admin_bar' , '__return_false'); // Remove admin menu # Configure FeedBurner if( isset($configs['feedburner']) ) function appthemes_custom_rss_feed( $output, $feed ) { if ( strpos( $output, 'comments' ) ) return $output; if( strpos($configs['feedburner'], '/')===FALSE ) return esc_url( 'http://feeds.feedburner.com/'.$configs['feedburner'] ); else return esc_url( $configs['feedburner'] ); } add_action( 'feed_link', 'appthemes_custom_rss_feed', 10, 2 ); # Favicon if( isset($configs['favicon']) ) { function __advsettings_favicon() { if( file_exists(TEMPLATEPATH.'/favicon.ico') ) echo ''."\r\n"; elseif( file_exists(TEMPLATEPATH.'/favicon.png') ) echo ''."\r\n"; } add_action( 'wp_head', '__advsettings_favicon' ); } # Add blog description meta tag if( isset($configs['description']) ) { function __advsettings_blog_description() { $configs = get_option('powerconfigs'); if(is_home() || !isset($configs['single_metas'])) echo ''."\r\n"; } add_action( 'wp_head', '__advsettings_blog_description' ); } # Add description and keyword meta tag in posts if( isset($configs['single_metas']) ) { function __advsettings_single_metas() { global $post; if( is_single() || is_page() ) { $tag_list = get_the_terms( $post->ID, 'post_tag' ); if( $tag_list ) { foreach( $tag_list as $tag ) $tag_array[] = $tag->name; echo ''."\r\n"; } $excerpt = strip_tags($post->post_content); $excerpt = strip_shortcodes($excerpt); $excerpt = str_replace(array('\n', '\r', '\t'), ' ', $excerpt); $excerpt = substr($excerpt, 0, 125); if( !empty($excerpt) ) echo ''."\r\n"; } } add_action( 'wp_head', '__advsettings_single_metas' ); } # Remove header generator if( isset($configs['remove_generator']) ) remove_action('wp_head', 'wp_generator'); # Remove WLW if( isset($configs['remove_wlw']) ) remove_action('wp_head', 'wlwmanifest_link'); # Remove update message from admin if( isset($configs['remove_update_msg']) ) { null; } # Thumbnails support if( isset($configs['add_thumbs']) ) add_theme_support( 'post-thumbnails' ); # JPEG Quality if( isset($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( isset($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' ); } # Fix post type pagination if( isset($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'); } # REL External if( isset($configs['disable_auto_save']) ) { function __advsettings_disable_auto_save(){ wp_deregister_script('autosave'); } add_action( 'wp_print_scripts', '__advsettings_disable_auto_save' ); } # Remove wptexturize if( isset($configs['remove_wptexturize']) ) { remove_filter('the_content', 'wptexturize'); remove_filter('comment_text', 'wptexturize'); remove_filter('the_excerpt', 'wptexturize'); } # Filtering the code if( isset($configs['compress']) || isset($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( isset($configs['analytics']) ) { add_action('wp_footer', '____analytics'); // Load custom styles function ____analytics(){ $configs = get_option('powerconfigs'); echo ''; } } # Remove admin menu if( isset($configs['show_query_num']) ) { function __show_sql_query_num(){ if( !current_user_can('manage_options') ) return; global $wpdb; echo '
'. $wpdb->num_queries.' '.__('SQL queries have been executed to show this page in '). timer_stop().__('seconds'). '
'; } add_action('wp_footer', '__show_sql_query_num'); } # Remove [...] from the excerpt /*if( $configs['remove_etc'] ) { function __trim_excerpt( $text ) { return rtrim( $text, '[...]' ); } add_filter('get_the_excerpt', '__trim_excerpt'); }*/ # author_bio if( isset($configs['author_bio']) ) { function __get_author_bio ($content=''){ return '
'. get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ) .'

'. sprintf( __( 'About %s' ), get_the_author() ) .'

'. get_the_author_meta( 'description' ) .'
'; } add_filter('the_content', '__get_author_bio'); } // ----------------------------------------------------------------------- # THE PAGE function __advanced_settings_page() { $configs = get_option('powerconfigs'); ?>

Advanced settings

Header







Images



Contents


System




HTML Code output




Footer