<?php

/*
Plugin Name: HomePageSites
Plugin URI: http://www.homepage.sites
Description: Custom home page plugin
Author: Ognjen Kuljic
Version: 1.0
Author URI: https://rs.linkedin.com/in/ognjenkuljic
*/



function homepagesitesInit() {
	register_post_type( 'references',
		array(
			'labels'				=> array(
				'name'			=> __('Portfolios'),
				'singular_name'	=> __('Portfolio')
			),
			'public'				=> true,
			'has_archive'			=> true,
			'exclude_from_search'	=> false,
			'show_in_nav_menus'		=> false,
			'show_in_menu'			=> true,
			'menu_position'			=> 6,
			'menu_icon'				=> 'dashicons-format-gallery',
			'capability_type'		=> 'post',
			'supports'				=> array(
				'title',
				'editor',
				'thumbnail',
				'excerpt',
				'custom-fields'
			)
		)
	);
}

add_action( 'init', 'homepagesitesInit' );

function homepagesitesOverrideMceOptions($initArray)
{
	$opts = '*[*]';
	$initArray['valid_elements'] = $opts;
	$initArray['extended_valid_elements'] = $opts;
	return $initArray;
}

add_filter('tiny_mce_before_init', 'homepagesitesOverrideMceOptions');