diff -r 000000000000 -r d970ebf37754 wp/wp-content/themes/IN-MOTION-package-u1/in-motion/functions/custom-portfolio.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wp/wp-content/themes/IN-MOTION-package-u1/in-motion/functions/custom-portfolio.php Wed Nov 06 03:21:17 2013 +0000 @@ -0,0 +1,284 @@ + _x('Portfolio', 'post type general name'), + 'singular_name' => _x('Portfolio Item', 'post type singular name'), + 'add_new' => _x('Add New', 'portfolio item'), + 'add_new_item' => __('Add New Portfolio Item','pego_tr'), + 'edit_item' => __('Edit Portfolio Item','pego_tr'), + 'new_item' => __('New Portfolio Item','pego_tr'), + 'view_item' => __('View Portfolio Item','pego_tr'), + 'search_items' => __('Search Portfolio','pego_tr'), + 'not_found' => __('Nothing found','pego_tr'), + 'not_found_in_trash' => __('Nothing found in Trash','pego_tr'), + 'parent_item_colon' => '' + ); + + $args = array( + 'labels' => $labels, + 'public' => true, + 'publicly_queryable' => true, + 'show_ui' => true, + 'query_var' => true, + 'rewrite' => true, + 'capability_type' => 'post', + 'hierarchical' => false, + 'menu_position' => null, + 'supports' => array('title','editor','thumbnail', 'custom-fields') + ); + + register_post_type( 'portfolio' , $args ); +} + +//portfolio editing + + add_action( 'admin_menu', 'hybrid_create_meta_box_portfolio' ); + add_action( 'save_post', 'hybrid_save_meta_data_portfolio' ); + +function hybrid_create_meta_box_portfolio() { + global $theme_name; + add_meta_box( 'post-meta-boxes_portfolio', __('Portfolio options','pego_tr'), 'post_meta_boxes_portfolio', 'portfolio', 'normal', 'high' ); + add_meta_box( 'post-meta-boxes_portfolio_video', __('Portfolio video options','pego_tr'), 'post_meta_boxes_portfolio_video', 'portfolio', 'normal', 'high' ); +} + +register_taxonomy("portfolio_categories", array("portfolio"), array("hierarchical" => true, "label" => "Portfolio categories", "singular_label" => "Portfolio categorie", "rewrite" => true)); + +function hybrid_post_meta_boxes_portfolio() { + + /* Array of the meta box options. */ + $meta_boxes = array( + 'portfolio_type_selected' => array( + 'name' => 'portfolio_type_selected', + 'title' => __(' Type', 'pego_tr'), + 'description' => __('Select portfolio type.', 'pego_tr'), + 'type' => "select", + 'std' => 'Image', + 'options' => array('Image', 'Slideshow', 'Video')), + 'portfolio_client' => array( + 'name' => 'portfolio_client', + 'title' => __("Site de l'intervenant", 'pego_tr'), + 'description' => __("Entrez le lien du site de l'intervenant.", 'pego_tr'), + 'type' => 'text' ), + 'portfolio_url' => array( + 'name' => 'portfolio_url', + 'title' => __('Controverse', 'pego_tr'), + 'description' => __('Entre le lien de la controverse.', 'pego_tr'), + 'type' => 'text' ), + 'portfolio_abstract' => array( + 'name' => 'portfolio_abstract', + 'title' => __('Abstract', 'pego_tr'), + 'description' => __("Entre le lien de l'abstract", 'pego_tr'), + 'type' => 'text' ), + 'portfolio_embed' => array( + 'name' => 'portfolio_embed', + 'title' => __('Embed sound cloud', 'pego_tr'), + 'description' => __("Placez ici l'embed de sound cloud", 'pego_tr'), + 'type' => 'text' ), + 'portfolio_twitter' => array( + 'name' => 'portfolio_twitter', + 'title' => __("Twitter de l'intervenant", 'pego_tr'), + 'description' => __("Placez ici seulement le nom twitter de l'intervenant (sans le @)", 'pego_tr'), + 'type' => 'text' ) + ); + + return apply_filters( 'hybrid_post_meta_boxes_portfolio', $meta_boxes ); +} + +function hybrid_post_meta_boxes_portfolio_video() { + + /* Array of the meta box options. */ + $meta_boxes = array( + 'portfolio_video_url' => array( + 'name' => 'portfolio_video_url', + 'title' => __('Video URL:', 'pego_tr'), + 'description' => __('Enter the embedded code of the portfolio.', 'pego_tr'), + 'type' => 'textarea' ) + ); + + return apply_filters( 'hybrid_post_meta_boxes_portfolio_video', $meta_boxes); +} + +function post_meta_boxes_portfolio() { + global $post; + $meta_boxes = hybrid_post_meta_boxes_portfolio(); ?> + +