_x( 'Portfolios', 'Portfolios', 'reviver' ), 'singular_name' => _x( 'Portfolio', 'Portfolio', 'reviver' ), 'menu_name' => __( 'Portfolios', 'reviver' ), 'parent_item_colon' => __( 'Parent Portoflio:', 'reviver' ), 'all_items' => __( 'All Portoflios', 'reviver' ), 'view_item' => __( 'View Portoflio', 'reviver' ), 'add_new_item' => __( 'Add New Portoflio', 'reviver' ), 'add_new' => __( 'Add New', 'reviver' ), 'edit_item' => __( 'Edit Portoflio', 'reviver' ), 'update_item' => __( 'Update Portoflio', 'reviver' ), 'search_items' => __( 'Search Portoflio', 'reviver' ), 'not_found' => __( 'Not found', 'reviver' ), 'not_found_in_trash' => __( 'Not found in Trash', 'reviver' ), ); $rewrite = array( 'slug' => 'portfolios', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'Portfolio', 'reviver' ), 'description' => __( 'Portfolio Description', 'reviver' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ), 'taxonomies' => array( 'portfolio-category'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'portfolio', $args ); $labels = array( 'name' => __('Portfolio Categories', 'reviver'), 'singular_name' => __('Portfolio Category', 'reviver'), 'search_items' => __('Search Portfolio Category', 'reviver'), 'all_items' => __('All Portfolio Category', 'reviver'), 'parent_item' => __('Parent Portfolio Category', 'reviver'), 'parent_item_colon' => __('Parent Portfolio Category:', 'reviver'), 'edit_item' => __('Edit Portfolio Category', 'reviver'), 'update_item' => __('Update Portfolio Category', 'reviver'), 'add_new_item' => __('Add New Portfolio Category', 'reviver'), 'new_item_name' => __('New Portfolio Category', 'reviver'), 'menu_name' => __('Categories', 'reviver') ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'query_var' => true, 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'portfolio', 'hierarchical' => true ) ); register_taxonomy('portfolio-category', 'portfolio', $args);}// Hook into the 'init' actionadd_action( 'init', 'portfolio_post_type', 0 );/** Testimonials Post Type **/function testimonials_post_type() { $labels = array( 'name' => _x( 'Testimonials', 'Testimonials', 'reviver' ), 'singular_name' => _x( 'Testimonial', 'Testimonial', 'reviver' ), 'menu_name' => __( 'Testimonials', 'reviver' ), 'parent_item_colon' => __( 'Parent Testimonial:', 'reviver' ), 'all_items' => __( 'All Testimonial', 'reviver' ), 'view_item' => __( 'View Testimonial', 'reviver' ), 'add_new_item' => __( 'Add New Testimonial', 'reviver' ), 'add_new' => __( 'Add New', 'reviver' ), 'edit_item' => __( 'Edit Testimonial', 'reviver' ), 'update_item' => __( 'Update Testimonial', 'reviver' ), 'search_items' => __( 'Search Testimonial', 'reviver' ), 'not_found' => __( 'Not found', 'reviver' ), 'not_found_in_trash' => __( 'Not found in Trash', 'reviver' ), ); $rewrite = array( 'slug' => 'testimonial', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'Testimonial', 'reviver' ), 'description' => __( 'Testimonial Description', 'reviver' ), 'labels' => $labels, 'supports' => array( 'title', 'editor','revision', 'thumbnail'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 6, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'testimonial', $args );}// Hook into the 'init' actionadd_action( 'init', 'testimonials_post_type', 0 );/** Clients Post Type **/function clients_post_type() { $labels = array( 'name' => _x( 'Clients', 'Clients', 'reviver' ), 'singular_name' => _x( 'Client', 'Client', 'reviver' ), 'menu_name' => __( 'Clients', 'reviver' ), 'parent_item_colon' => __( 'Parent Client:', 'reviver' ), 'all_items' => __( 'All Clients', 'reviver' ), 'view_item' => __( 'View Client', 'reviver' ), 'add_new_item' => __( 'Add New Client', 'reviver' ), 'add_new' => __( 'Add New', 'reviver' ), 'edit_item' => __( 'Edit Client', 'reviver' ), 'update_item' => __( 'Update Client', 'reviver' ), 'search_items' => __( 'Search Client', 'reviver' ), 'not_found' => __( 'Not found', 'reviver' ), 'not_found_in_trash' => __( 'Not found in Trash', 'reviver' ), ); $rewrite = array( 'slug' => 'clients', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'Clients', 'reviver' ), 'description' => __( 'Client Description', 'reviver' ), 'labels' => $labels, 'supports' => array( 'title', 'editor','revision', 'thumbnail'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 6, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'clients', $args );}// Hook into the 'init' actionadd_action( 'init', 'clients_post_type', 0 );/** Clients Post Type **/function mfields_set_default_object_terms( $post_id, $post ) { if ( 'publish' === $post->post_status && $post->post_type === 'portfolio' ) { $defaults = array( 'portfolio-category' => array( 'uncategorized' ) //'your_taxonomy_id' => array( 'your_term_slug', 'your_term_slug' ) ); $taxonomies = get_object_taxonomies( $post->post_type ); foreach ( (array) $taxonomies as $taxonomy ) { $terms = wp_get_post_terms( $post_id, $taxonomy ); if ( empty( $terms ) && array_key_exists( $taxonomy, $defaults ) ) { wp_set_object_terms( $post_id, $defaults[$taxonomy], $taxonomy ); } } }}add_action( 'save_post', 'mfields_set_default_object_terms', 100, 2 );/** FAQs Post Type **/function faqs_post_type() { $labels = array( 'name' => _x( 'FAQs', 'FAQs', 'reviver' ), 'singular_name' => _x( 'FAQ', 'FAQ', 'reviver' ), 'menu_name' => __( 'FAQs', 'reviver' ), 'parent_item_colon' => __( 'Parent FAQs:', 'reviver' ), 'all_items' => __( 'All FAQs', 'reviver' ), 'view_item' => __( 'View FAQs', 'reviver' ), 'add_new_item' => __( 'Add New FAQs', 'reviver' ), 'add_new' => __( 'Add New', 'reviver' ), 'edit_item' => __( 'Edit FAQs', 'reviver' ), 'update_item' => __( 'Update FAQs', 'reviver' ), 'search_items' => __( 'Search FAQs', 'reviver' ), 'not_found' => __( 'Not found', 'reviver' ), 'not_found_in_trash' => __( 'Not found in Trash', 'reviver' ), ); $rewrite = array( 'slug' => 'faqs', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'FAQs', 'reviver' ), 'description' => __( 'FAQs Description', 'reviver' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ), 'taxonomies' => array( 'faq-category'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'faq', $args ); $labels = array( 'name' => __('FAQs Categories', 'reviver'), 'singular_name' => __('FAQs Category', 'reviver'), 'search_items' => __('Search FAQs Category', 'reviver'), 'all_items' => __('All FAQs Category', 'reviver'), 'parent_item' => __('Parent FAQs Category', 'reviver'), 'parent_item_colon' => __('Parent FAQs Category:', 'reviver'), 'edit_item' => __('Edit FAQs Category', 'reviver'), 'update_item' => __('Update FAQs Category', 'reviver'), 'add_new_item' => __('Add New FAQs Category', 'reviver'), 'new_item_name' => __('New FAQs Category', 'reviver'), 'menu_name' => __('Categories', 'reviver') ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'query_var' => true, 'show_in_nav_menus' => true, 'rewrite' => array( 'slug' => 'faq', 'hierarchical' => true ) ); register_taxonomy('faq-category', 'faq', $args);}// Hook into the 'init' actionadd_action( 'init', 'faqs_post_type', 0 );if( ! function_exists('reviver_registration_form')){function reviver_registration_form( $username, $password, $email, $website, $first_name, $last_name, $nickname, $bio ) { echo '
';}}if( ! function_exists('reviver_registration_validation')){function reviver_registration_validation($username, $password, $email){ if(isset($_POST['submit']) && $_POST['submit']){ global $reg_errors; $reg_errors = new WP_Error; if ( empty( $username ) || empty( $password ) || empty( $email ) ) { $reg_errors->add('field', __('Required form field is missing (Username, Password or Email)','reviver')); } if ( 4 > strlen( $username ) ) { $reg_errors->add( 'username_length', __('Username too short. At least 4 characters is required','reviver') ); } if ( username_exists( $username ) ) $reg_errors->add('user_name', __('Sorry, that username already exists!','reviver')); if ( ! validate_username( $username ) ) { $reg_errors->add( 'username_invalid', __('Sorry, the username you entered is not valid','reviver') ); } if ( 5 > strlen( $password ) ) { $reg_errors->add( 'password', __('Password length must be greater than 5','reviver') ); } if ( !is_email( $email ) ) { $reg_errors->add( 'email_invalid', __('Email is not valid' ,'reviver')); } if ( email_exists( $email ) ) { $reg_errors->add( 'email', __('Email Already in use','reviver') ); } if ( ! empty( $website ) ) { if ( ! filter_var( $website, FILTER_VALIDATE_URL ) ) { $reg_errors->add( 'website', __('Website is not a valid URL','reviver') ); } } if ( is_wp_error( $reg_errors ) ) { foreach ( $reg_errors->get_error_messages() as $error ) { echo '
'; echo ''; echo ''.__("ERROR",'reviver').': '; echo $error . '
'; echo '
'; } echo '
'; } }}}if( ! function_exists('reviver_complete_registration')){function reviver_complete_registration() { global $reg_errors, $username, $password, $email, $website, $first_name, $last_name, $nickname, $bio; if ( 1 > count( $reg_errors->get_error_messages() ) ) { $userdata = array( 'user_login' => $username, 'user_email' => $email, 'user_pass' => $password, 'user_url' => $website, 'first_name' => $first_name, 'last_name' => $last_name, 'nickname' => $nickname, 'description' => $bio, ); $user = wp_insert_user( $userdata ); echo '
'; echo ''; echo __('Registration complete.','reviver').' '.__("Go to",'reviver').' '.__("login page",'reviver').'.'; echo '

'; $_POST = ''; }}}if( ! function_exists('reviver_registration_function')){function reviver_registration_function() { if ( isset($_POST['submit'] ) ) { reviver_registration_validation( $_POST['username'], $_POST['password'], $_POST['email'], $_POST['website'], $_POST['fname'], $_POST['lname'], $_POST['nickname'], $_POST['bio'] ); // sanitize user form input global $username, $password, $email, $website, $first_name, $last_name, $nickname, $bio; $username = sanitize_user( $_POST['username'] ); $password = esc_attr( $_POST['password'] ); $email = sanitize_email( $_POST['email'] ); $website = esc_url( $_POST['website'] ); $first_name = sanitize_text_field( $_POST['fname'] ); $last_name = sanitize_text_field( $_POST['lname'] ); $nickname = sanitize_text_field( $_POST['nickname'] ); $bio = esc_textarea( $_POST['bio'] ); // call @function complete_registration to create the user // only when no WP_error is found reviver_complete_registration( $username, $password, $email, $website, $first_name, $last_name, $nickname, $bio ); } reviver_registration_form( isset($_POST['username']) ? $username : '', isset($_POST['password']) ? $password : '', isset($_POST['email']) ? $email : '', isset($_POST['website']) ? $website : '', isset($_POST['first_name']) ? $first_name : '', isset($_POST['last_name']) ? $last_name : '', isset($_POST['nickname']) ? $nickname : '', isset($_POST['bio']) ? $bio : '' );}}// Register a new shortcode: [reviver_user_registeration_form]add_shortcode( 'reviver_user_registeration_form', 'reviver_user_registeration_form' ); // The callback function that will replace [book]function reviver_user_registeration_form() { ob_start(); reviver_registration_function(); return ob_get_clean();}function get_line_break() { return '
';}add_shortcode('reviver_break', 'get_line_break');if(!function_exists("reviver_registration_form2") && !function_exists("reviver_registration_form_complete")) { function reviver_registration_form2($atts, $content){ extract(shortcode_atts( array( "form_title" => __("Sign Up with a Free Account",'reviver'), "btn_value" => __("Create My Account",'reviver') ), $atts)); $output = ''; $msg = ''; if (isset($_POST['rev_registration_submit'])) { $msg = reviver_registration_form_complete($_POST); } $output .= '
'; $output .= '

' . esc_attr($form_title) . '

'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; if ($msg == 'success') { $output .='
'; $output .=''; $output .='

'.__("Registration complete.",'reviver').' '.__("Go to",'reviver').' '.__("login page",'reviver').'

'; $output .='
'; } elseif ($msg != '') { $output .='
'; $output .=''; $output .='

'.$msg.'

'; $output .='
'; } $output .= '
'; return $output; } add_shortcode("reviver_registration_form", "reviver_registration_form2"); function reviver_registration_form_complete($form_fields){ $username = $form_fields['rev_username']; $email = $form_fields['rev_email']; $password = $form_fields['rev_password']; $msg = ''; $username = sanitize_user($username); $password = esc_attr($password); $email = sanitize_email($email); if (empty($username) || empty($password) || empty($email)) { return __('Required form field is missing','reviver'); } if (6 > strlen($username) || !validate_username($username)) { return __('Username too short. At least 6 characters is required','reviver'); } if (6 > strlen($password)) { return __('Password too short. At least 6 characters is required','reviver'); } if (!is_email($email)) { return __("Invalid Email Format",'reviver'); } if (username_exists($username)) { return __('Sorry, that username already exists!','reviver'); } if (email_exists($email)) { return __('Email Already in use','reviver'); } $userdata = array( 'user_login' => $username, 'user_email' => $email, 'user_pass' => $password, ); if (wp_insert_user($userdata)) { return "success"; } }}function reviver_tooltip($atts, $text = ''){ extract(shortcode_atts(array( 'position' => 'top', 'content' => 'tooltip content', 'link' => '#' ),$atts)); return ''.esc_attr($text).'';}add_shortcode('reviver_tooltip', 'reviver_tooltip');/* Load VC Extend */require_once dirname( __FILE__ ).'/vc_extend.php';?>