elements. * * @see Walker * @see wp_category_checklist() * @see wp_terms_checklist() * @since 2.5.1 */ class Walker_Category_Checklist extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat("\t", $depth); $output .= "$indent
'newmeta-submit', 'data-wp-lists' => 'add:the-list:newmeta' ) ); ?>
|
$template"; endforeach; } /** * {@internal Missing Short Description}} * * @since 1.5.0 * * @param unknown_type $default * @param unknown_type $parent * @param unknown_type $level * @return unknown */ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { global $wpdb; $post = get_post(); $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) ); if ( $items ) { foreach ( $items as $item ) { // A page cannot be its own parent. if ( $post && $post->ID && $item->ID == $post->ID ) continue; $pad = str_repeat( ' ', $level * 3 ); if ( $item->ID == $default) $current = ' selected="selected"'; else $current = ''; echo "\n\t"; parent_dropdown( $default, $item->ID, $level +1 ); } } else { return false; } } /** * {@internal Missing Short Description}} * * @since 2.0.0 * * @param unknown_type $id * @return unknown */ function the_attachment_links( $id = false ) { $id = (int) $id; $post = get_post( $id ); if ( $post->post_type != 'attachment' ) return false; $icon = wp_get_attachment_image( $post->ID, 'thumbnail', true ); $attachment_data = wp_get_attachment_metadata( $id ); $thumb = isset( $attachment_data['thumb'] ); ?> html elements for role selectors * * @since 2.1.0 * * @param string $selected slug for the role that should be already selected */ function wp_dropdown_roles( $selected = false ) { $p = ''; $r = ''; $editable_roles = get_editable_roles(); foreach ( $editable_roles as $role => $details ) { $name = translate_user_role($details['name'] ); if ( $selected == $role ) // preselect specified role $p = "\n\t"; else $r .= "\n\t"; } echo $p . $r; } /** * Outputs the form used by the importers to accept the data to be imported * * @since 2.0.0 * * @param string $action The action attribute for the form. */ function wp_import_upload_form( $action ) { $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() ); $size = size_format( $bytes ); $upload_dir = wp_upload_dir(); if ( ! empty( $upload_dir['error'] ) ) : ?>
) * @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'. */ function add_settings_error( $setting, $code, $message, $type = 'error' ) { global $wp_settings_errors; if ( !isset($wp_settings_errors) ) $wp_settings_errors = array(); $new_error = array( 'setting' => $setting, 'code' => $code, 'message' => $message, 'type' => $type ); $wp_settings_errors[] = $new_error; } /** * Fetch settings errors registered by add_settings_error() * * Checks the $wp_settings_errors array for any errors declared during the current * pageload and returns them. * * If changes were just submitted ($_GET['settings-updated']) and settings errors were saved * to the 'settings_errors' transient then those errors will be returned instead. This * is used to pass errors back across pageloads. * * Use the $sanitize argument to manually re-sanitize the option before returning errors. * This is useful if you have errors or notices you want to show even when the user * hasn't submitted data (i.e. when they first load an options page, or in admin_notices action hook) * * @since 3.0.0 * * @global array $wp_settings_errors Storage array of errors registered during this pageload * * @param string $setting Optional slug title of a specific setting who's errors you want. * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors. * @return array Array of settings errors */ function get_settings_errors( $setting = '', $sanitize = false ) { global $wp_settings_errors; // If $sanitize is true, manually re-run the sanitization for this option // This allows the $sanitize_callback from register_setting() to run, adding // any settings errors you want to show by default. if ( $sanitize ) sanitize_option( $setting, get_option( $setting ) ); // If settings were passed back from options.php then use them if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] && get_transient( 'settings_errors' ) ) { $wp_settings_errors = array_merge( (array) $wp_settings_errors, get_transient( 'settings_errors' ) ); delete_transient( 'settings_errors' ); } // Check global in case errors have been added on this pageload if ( ! count( $wp_settings_errors ) ) return array(); // Filter the results to those of a specific setting if one was set if ( $setting ) { $setting_errors = array(); foreach ( (array) $wp_settings_errors as $key => $details ) { if ( $setting == $details['setting'] ) $setting_errors[] = $wp_settings_errors[$key]; } return $setting_errors; } return $wp_settings_errors; } /** * Display settings errors registered by add_settings_error() * * Part of the Settings API. Outputs a
{$details['message']}
"; $output .= "