<?php
/**
 * Changes post type labels and slugs based on theme options settings.
 * @package Ultra WordPress Theme
 * @since 1.0
 * @author AJ Clarke : http://wpexplorer.com
 * @copyright Copyright (c) 2012, AJ Clarke
 * @link http://wpexplorer.com
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */



/**
* Portfolio Post Type
* @since 1.0
*/
if ( ! function_exists( 'wpex_custom_portfolio_args' ) ) {
	function wpex_custom_portfolio_args( $args ) {
		
		//post name based on theme options
		$post_type_name = ( of_get_option('portfolio_labels','Portfolio') ) ? of_get_option('portfolio_labels','Portfolio') : 'Portfolio';
		$post_slug = ( of_get_option('portfolio_slug','portfolio') ) ? of_get_option('portfolio_slug','portfolio') : 'portfolio';
		
		$labels = array(
			'name' => $post_type_name,
			'singular_name' => $post_type_name . __( 'Item', 'wpex' ),
			'add_new' => __( 'Add New Item', 'wpex' ),
			'add_new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'edit_item' => __( 'Edit New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'view_item' => __( 'View Item', 'wpex' ),
			'search_items' => __( 'Search', 'wpex' ). $post_type_name,
			'not_found' =>  __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found', 'wpex' ),
			'not_found_in_trash' => __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found in the trash', 'wpex' ),
		);
		
		$custom_args = array(
			'labels' => $labels,
			'rewrite' => array("slug" => $post_slug)
		);
		return $custom_args + $args;
	}
	add_filter( 'symple_portfolio_args', 'wpex_custom_portfolio_args' );
}




/**
* Services Post Type
* @since 1.0
*/
if ( ! function_exists( 'wpex_custom_services_args' ) ) {
	function wpex_custom_services_args( $args ) {
		
		//post name based on theme options
		$post_type_name = ( of_get_option('services_labels','Services') ) ? of_get_option('services_labels','Services') : 'Services';
		$post_slug = ( of_get_option('services_slug','services') ) ? of_get_option('services_slug','services') : 'services';
		
		$labels = array(
			'name' => $post_type_name,
			'singular_name' => $post_type_name . __( 'Item', 'wpex' ),
			'add_new' => __( 'Add New Item', 'wpex' ),
			'add_new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'edit_item' => __( 'Edit New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'view_item' => __( 'View Item', 'wpex' ),
			'search_items' => __( 'Search', 'wpex' ). $post_type_name,
			'not_found' =>  __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found', 'wpex' ),
			'not_found_in_trash' => __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found in the trash', 'wpex' ),
		);
		
		$custom_args = array(
			'labels' => $labels,
			'rewrite' => array("slug" => $post_slug),
		);
		return $custom_args + $args;
	}
	add_filter( 'symple_services_args', 'wpex_custom_services_args' );
}



/**
* FAQ Post Type
* @since 1.0
*/
if ( ! function_exists( 'wpex_custom_faq_args' ) ) {
	function wpex_custom_faq_args( $args ) {
		
		//post name based on theme options
		$post_type_name = ( of_get_option('faq_labels','FAQ') ) ? of_get_option('faq_labels','FAQ') : 'FAQ';
		$post_slug = ( of_get_option('faq_slug','faq') ) ? of_get_option('faq_slug','faq') : 'faq';
		
		$labels = array(
			'name' => $post_type_name,
			'singular_name' => $post_type_name . __( 'Item', 'wpex' ),
			'add_new' => __( 'Add New Item', 'wpex' ),
			'add_new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'edit_item' => __( 'Edit New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'view_item' => __( 'View Item', 'wpex' ),
			'search_items' => __( 'Search', 'wpex' ). $post_type_name,
			'not_found' =>  __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found', 'wpex' ),
			'not_found_in_trash' => __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found in the trash', 'wpex' ),
		);
		
		$custom_args = array(
			'labels' => $labels,
			'rewrite' => array("slug" => $post_slug),
		);
		return $custom_args + $args;
	}
	add_filter( 'symple_faq_args', 'wpex_custom_faq_args' );
}


/**
* Staff Post Type
* @since 1.0
*/
if ( ! function_exists( 'wpex_custom_staff_args' ) ) {
	function wpex_custom_staff_args( $args ) {
		
		//post name based on theme options
		$post_type_name = ( of_get_option('staff_labels','Staff') ) ? of_get_option('staff_labels','Staff') : 'Staff';
		$post_slug = ( of_get_option('staff_slug','staff') ) ? of_get_option('staff_slug','staff') : 'staff';
		
		$labels = array(
			'name' => $post_type_name,
			'singular_name' => $post_type_name . __( 'Item', 'wpex' ),
			'add_new' => __( 'Add New Item', 'wpex' ),
			'add_new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'edit_item' => __( 'Edit New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'view_item' => __( 'View Item', 'wpex' ),
			'search_items' => __( 'Search', 'wpex' ). $post_type_name,
			'not_found' =>  __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found', 'wpex' ),
			'not_found_in_trash' => __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found in the trash', 'wpex' ),
		);
		
		$custom_args = array(
			'labels' => $labels,
			'rewrite' => array("slug" => $post_slug),
		);
		return $custom_args + $args;
	}
	add_filter( 'symple_staff_args', 'wpex_custom_staff_args' );
}


/**
* Testimonials Post Type
* @since 1.0
*/
if ( ! function_exists( 'wpex_custom_testimonials_args' ) ) {
	function wpex_custom_testimonials_args( $args ) {
		
		//post name based on theme options
		$post_type_name = ( of_get_option('testimonials_labels','Testimonials') ) ? of_get_option('testimonials_labels','Testimonials') : 'Testimonials';
		$post_slug = ( of_get_option('testimonials_slug','testimonials') ) ? of_get_option('testimonials_slug','testimonials') : 'testimonials';
		
		$labels = array(
			'name' => $post_type_name,
			'singular_name' => $post_type_name . __( 'Item', 'wpex' ),
			'add_new' => __( 'Add New Item', 'wpex' ),
			'add_new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'edit_item' => __( 'Edit New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'new_item' => __( 'Add New','wpex') . ' ' . $post_type_name . ' ' . __( 'Item', 'wpex' ),
			'view_item' => __( 'View Item', 'wpex' ),
			'search_items' => __( 'Search', 'wpex' ). $post_type_name,
			'not_found' =>  __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found', 'wpex' ),
			'not_found_in_trash' => __( 'No','wpex') . ' ' . $post_type_name . ' ' . __( 'items found in the trash', 'wpex' ),
		);
		
		$custom_args = array(
			'labels' => $labels,
			'rewrite' => array("slug" => $post_slug),
		);
		return $custom_args + $args;
	}
	add_filter( 'symple_testimonials_args', 'wpex_custom_testimonials_args' );
}