ttings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); } /** * Add a new field to a settings page. * * @since 2.7.0 * * @param string $id String for use in the 'id' attribute of tags. * @param string $title Title of the field. * @param string $callback Function that fills the field with the desired content. The function should echo its output. * @param string $page The type of settings page on which to show the field (general, reading, writing, ...). * @param string $section The section of the settingss page in which to show the box (default, ...). * @param array $args Additional arguments */ function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) { global $wp_settings_fields; if ( !isset($wp_settings_fields) ) $wp_settings_fields = array(); if ( !isset($wp_settings_fields[$page]) ) $wp_settings_fields[$page] = array(); if ( !isset($wp_settings_fields[$page][$section]) ) $wp_settings_fields[$page][$section] = array(); $wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args); } /** * {@internal Missing Short Description}} * * @since unknown * * @param unknown_type $page */ function do_settings_sections($page) { global $wp_settings_sections, $wp_settings_fields; if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) ) return; foreach ( (array) $wp_settings_sections[$page] as $section ) { echo "

{$section['title']}

\n"; call_user_func($section['callback'], $section); if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]) ) continue; echo ''; do_settings_fields($page, $section['id']); echo '
'; } } /** * {@internal Missing Short Description}} * * @since unknown * * @param unknown_type $page * @param unknown_type $section */ function do_settings_fields($page, $section) { global $wp_settings_fields; if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) ) return; foreach ( (array) $wp_settings_fields[$page][$section] as $field ) { echo ''; if ( !empty($field['args']['label_for']) ) echo ''; else echo '' . $field['title'] . ''; echo ''; call_user_func($field['callback']); echo ''; echo ''; } } /** * {@internal Missing Short Description}} * * @since unknown * * @param unknown_type $page */ function manage_columns_prefs($page) { $columns = get_column_headers($page); $hidden = get_hidden_columns($page); foreach ( $columns as $column => $title ) { // Can't hide these if ( 'cb' == $column || 'title' == $column || 'name' == $column || 'username' == $column || 'media' == $column || 'comment' == $column ) continue; if ( empty($title) ) continue; if ( 'comments' == $column ) $title = __('Comments'); $id = "$column-hide"; echo '\n"; } } /** * {@internal Missing Short Description}} * * @since unknown * * @param unknown_type $found_action */ function find_posts_div($found_action = '') { ?> post_password ) ) echo attribute_escape( $post->post_password ); } /** * {@internal Missing Short Description}} * * @since unknown */ function favorite_actions() { $actions = array( 'post-new.php' => array(__('New Post'), 'edit_posts'), 'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'), 'page-new.php' => array(__('New Page'), 'edit_pages'), 'media-new.php' => array(__('Upload'), 'upload_files'), 'edit-comments.php' => array(__('Comments'), 'moderate_comments') ); $actions = apply_filters('favorite_actions', $actions); $allowed_actions = array(); foreach ( $actions as $action => $data ) { if ( current_user_can($data[1]) ) $allowed_actions[$action] = $data[0]; } if ( empty($allowed_actions) ) return; $first = array_keys($allowed_actions); $first = $first[0]; echo '
'; echo '
' . $allowed_actions[$first] . '

'; echo '
'; array_shift($allowed_actions); foreach ( $allowed_actions as $action => $label) { echo "\n"; } echo "
\n"; } /** * Get the post title. * * The post title is fetched and if it is blank then a default string is * returned. * * @since 2.7.0 * @param int $id The post id