+
+ echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file );
+ if ( is_rtl() )
+ echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . esc_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" );
+}
+
+/**
+ * Enqueues the default ThickBox js and css.
+ *
+ * If any of the settings need to be changed, this can be done with another js
+ * file similar to media-upload.js and theme-preview.js. That file should
+ * require array('thickbox') to ensure it is loaded after.
+ *
+ * @since 2.5.0
+ */
+function add_thickbox() {
+ wp_enqueue_script( 'thickbox' );
+ wp_enqueue_style( 'thickbox' );
+}
+
+/**
+ * Display the XHTML generator that is generated on the wp_head hook.
+ *
+ * @since 2.5.0
+ */
+function wp_generator() {
+ the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) );
+}
+
+/**
+ * Display the generator XML or Comment for RSS, ATOM, etc.
+ *
+ * Returns the correct generator type for the requested output format. Allows
+ * for a plugin to filter generators overall the the_generator filter.
+ *
+ * @since 2.5.0
+ * @uses apply_filters() Calls 'the_generator' hook.
+ *
+ * @param string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).
+ */
+function the_generator( $type ) {
+ echo apply_filters('the_generator', get_the_generator($type), $type) . "\n";
+}
+
+/**
+ * Creates the generator XML or Comment for RSS, ATOM, etc.
+ *
+ * Returns the correct generator type for the requested output format. Allows
+ * for a plugin to filter generators on an individual basis using the
+ * 'get_the_generator_{$type}' filter.
+ *
+ * @since 2.5.0
+ * @uses apply_filters() Calls 'get_the_generator_$type' hook.
+ *
+ * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).
+ * @return string The HTML content for the generator.
+ */
+function get_the_generator( $type = '' ) {
+ if ( empty( $type ) ) {
+
+ $current_filter = current_filter();
+ if ( empty( $current_filter ) )
+ return;
+
+ switch ( $current_filter ) {
+ case 'rss2_head' :
+ case 'commentsrss2_head' :
+ $type = 'rss2';
+ break;
+ case 'rss_head' :
+ case 'opml_head' :
+ $type = 'comment';
+ break;
+ case 'rdf_header' :
+ $type = 'rdf';
+ break;
+ case 'atom_head' :
+ case 'comments_atom_head' :
+ case 'app_head' :
+ $type = 'atom';
+ break;
+ }
+ }
+
+ switch ( $type ) {
+ case 'html':
+ $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
+ break;
+ case 'xhtml':
+ $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '" />';
+ break;
+ case 'atom':
+ $gen = '<generator uri="http://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>';
+ break;
+ case 'rss2':
+ $gen = '<generator>http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>';
+ break;
+ case 'rdf':
+ $gen = '<admin:generatorAgent rdf:resource="http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />';
+ break;
+ case 'comment':
+ $gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
+ break;
+ case 'export':
+ $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '"-->';
+ break;
+ }
+ return apply_filters( "get_the_generator_{$type}", $gen, $type );
+}
+
+/**
+ * Outputs the html checked attribute.
+ *
+ * Compares the first two arguments and if identical marks as checked
+ *
+ * @since 1.0
+ *
+ * @param mixed $checked One of the values to compare
+ * @param mixed $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @return string html attribute or empty string
+ */
+function checked( $checked, $current = true, $echo = true ) {
+ return __checked_selected_helper( $checked, $current, $echo, 'checked' );
+}
+
+/**
+ * Outputs the html selected attribute.
+ *
+ * Compares the first two arguments and if identical marks as selected
+ *
+ * @since 1.0
+ *
+ * @param mixed selected One of the values to compare
+ * @param mixed $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @return string html attribute or empty string
+ */
+function selected( $selected, $current = true, $echo = true ) {
+ return __checked_selected_helper( $selected, $current, $echo, 'selected' );
+}
+
+/**
+ * Outputs the html disabled attribute.
+ *
+ * Compares the first two arguments and if identical marks as disabled
+ *
+ * @since 3.0.0
+ *
+ * @param mixed $disabled One of the values to compare
+ * @param mixed $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @return string html attribute or empty string
+ */
+function disabled( $disabled, $current = true, $echo = true ) {
+ return __checked_selected_helper( $disabled, $current, $echo, 'disabled' );
+}
+
+/**
+ * Private helper function for checked, selected, and disabled.
+ *
+ * Compares the first two arguments and if identical marks as $type
+ *
+ * @since 2.8
+ * @access private
+ *
+ * @param any $helper One of the values to compare
+ * @param any $current (true) The other value to compare if not just true
+ * @param bool $echo Whether to echo or just return the string
+ * @param string $type The type of checked|selected|disabled we are doing
+ * @return string html attribute or empty string
+ */
+function __checked_selected_helper( $helper, $current, $echo, $type ) {
+ if ( (string) $helper === (string) $current )
+ $result = " $type='$type'";
+ else
+ $result = '';
+
+ if ( $echo )
+ echo $result;
+
+ return $result;