false); $file = wp_handle_upload($_FILES[$file_index], $overrides); if (isset($file['error'])) wp_die($file['error']); $url = $file['url']; $type = $file['type']; $file = $file['file']; $filename = basename($file); // Construct The Object Array $object = array( 'post_title' => $filename, 'post_content' => $url, 'post_mime_type' => $type, 'guid' => $url ); // Save The Data $id = wp_insert_attachment($object, $file); // Add The Meta wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $file)); do_action('wp_create_file_in_uploads', $file, $id); // For replication return esc_url($url); } add_action('parse_request', 'my_custom_css'); function my_custom_css($wp) { if (!empty($_GET['custom-content']) && $_GET['custom-content'] == 'css') { header('Content-Type: text/css'); require dirname(__FILE__) . '/style-custom.php'; exit; } } function wptube_admin() { $option_fields = array(); if ($_GET['updated']) echo '

Tube Theme Options Saved.

'; echo ''; // Accordion Script echo ''; echo ''; echo ''; ?>

Tube Theme Options

" />
'Home Sidebar', 'description' => __('Home Sidebar Section'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Single Sidebar', 'description' => __('Sidebar Section'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer#1', 'description' => __('Footer#1 Section'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer#2', 'description' => __('Footer#1 Section'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer#3', 'description' => __('Footer#1 Section'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer#4', 'description' => __('Footer#1 Section'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } function get_page_id($page_name) { global $wpdb; $page_name = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '" . $page_name . "' AND post_status = 'publish' AND post_type = 'page'"); return $page_name; } function tube_get_limited_string($output, $max_char) { $output = str_replace(']]>', ']]>', $output); $output = strip_tags($output); if ((strlen($output) > $max_char) && ($espacio = strpos($output, " ", $max_char))) { $output = substr($output, 0, $espacio) . '...'; return $output; } else { return $output; } } function tube_getcustomfield($filedname, $page_current_id = NULL) { if ($page_current_id == NULL) $page_current_id = get_page_id(); $value = get_post_meta($page_current_id, $filedname, true); return $value; } function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) : case '' : ?>
  • id="comment-">

    By:

    comment_approved == '0') : ?>