coningham
1/30/2015 - 1:34 AM

Must-use plugins

Must-use plugins

<?php
/*
Plugin Name: Shortcodes
Description: Shortcodes extras para um melhor funcionamento do tema.
Version: 1
Author: Jaci Coningham
Author URI: http://www.designemeio.com.br/
*/

//email without spam
function email_encode_function( $atts, $content ){
     return '<a href="'.antispambot("mailto:".$content).'">'.antispambot($content).'</a>';
}
add_shortcode( 'email', 'email_encode_function' );

//add shortcodes to text widgets
add_filter( 'widget_text', 'do_shortcode' );

?>
<?php
/*
Plugin Name: Segurança
Description: Opções para aumentar a segurança do site.
Version: 1
Author: Jaci Coningham
Author URI: http://www.designemeio.com.br/
*/

//remove theme editor submenu
function remove_editor_menu() {
  remove_action('admin_menu', '_add_themes_utility_last', 101);
}
add_action('_admin_menu', 'remove_editor_menu', 1);

//remover versão wp
function remove_wp_version(){ 
return ''; 
} 
add_filter('the_generator', 'remove_wp_version'); 

?>
<?php
/*
Plugin Name: RSS
Description: Mais opções para assinantes da feed.
Version: 1
Author: Jaci Coningham
Author URI: http://www.designemeio.com.br/
*/

//display featured images in RSS feed
add_filter('the_content_feed', 'rss_post_thumbnail');
function rss_post_thumbnail($content) {global $post;
if( has_post_thumbnail($post->ID) )$content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content;
return $content;
}

//include post types in rss feed
function myfeed_request($qv) {
	if (isset($qv['feed']))
		$qv['post_type'] = get_post_types();
	return $qv;
}
add_filter('request', 'myfeed_request');

?>
<?php
/*
Plugin Name: Menus
Description: Melhor organização dos menus.
Version: 1
Author: Jaci Coningham
Author URI: http://www.designemeio.com.br/
*/

//remover menus
add_action( 'admin_menu', 'adeus_menus' );
    function adeus_menus() {
		remove_menu_page('edit.php?post_type=client');
		remove_menu_page('edit.php?post_type=portfolio');
		remove_menu_page('edit.php?post_type=testimonial');
		remove_menu_page('edit.php?post_type=team');
		remove_menu_page('edit.php?post_type=nectar_slider');
    }
	
?>