Widgets and add it to your sidebar. If you click on the configure icon, you can add whatever title you want (the default title is ‘BLOGROLL’) and change the Order By, Order and Limit options for your blogroll. */ // We're putting the plugin's functions in one big function we then // call at 'plugins_loaded' (add_action() at bottom) to ensure the // required Sidebar Widget functions are available. function bookmarks_displayer_widget_init() { // Check to see required Widget API functions are defined... if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') ) return; // ...and if not, exit gracefully from the script. // This function prints the sidebar widget--the cool stuff! function bookmarks_displayer_widget($args) { // $args is an array of strings which help your widget // conform to the active theme: before_widget, before_title, // after_widget, and after_title are the array keys. extract($args); // Collect our widget's options, or define their defaults. $options = get_option('bookmarks_displayer_widget'); $title = empty( $options['title'] ) ? 'Blogroll' : $options['title']; $text = empty( $options['text'] ) ? 'name' : $options['text']; $order = empty( $options['order'] ) ? 'ASC' : $options['order']; $limit = empty( $options['limit'] ) ? '-1' : $options['limit']; $category = empty( $options['category'] ) ? '' : $options['category']; // It's important to use the $before_widget, $before_title, // $after_title and $after_widget variables in your output. echo $before_widget; echo $before_title . $title . $after_title; wp_bookmarks_order( $title, $text, $order, $limit, $category ); echo $after_widget; } // This is the function that outputs the form to let users edit // the widget's title and so on. It's an optional feature, but // we'll use it because we can! function bookmarks_displayer_widget_control() { // Collect our widget's options. $options = $newoptions = get_option('bookmarks_displayer_widget'); if ( !is_array($options) ) $options = $newoptions = array(); // This is for handing the control form submission. if ( isset( $_POST[ "bookmarks_displayer_widget-submit" ] ) ) { // Clean up control form submission options $newoptions['title'] = strip_tags(stripslashes($_POST["bookmarks_widget-title"])); $newoptions['text'] = strip_tags(stripslashes($_POST["bookmarks_widget-text"])); $newoptions['order'] = strip_tags(stripslashes($_POST["bookmarks_widget-order"])); $newoptions['limit'] = strip_tags(stripslashes($_POST["bookmarks_widget-limit"])); $newoptions['category'] = strip_tags(stripslashes($_POST["bookmarks_widget-category"])); } // If original widget options do not match control form // submission options, update them. if ( $options != $newoptions ) { $options = $newoptions; update_option('bookmarks_displayer_widget', $options); } // Format options as valid HTML. $title = htmlspecialchars( $options['title'], ENT_QUOTES); $text = htmlspecialchars( $options['text'], ENT_QUOTES); $order = htmlspecialchars( $options['order'], ENT_QUOTES); $limit = htmlspecialchars( $options['limit'], ENT_QUOTES); $category = htmlspecialchars( $options['category'], ENT_QUOTES); // The HTML below is the control form for editing options. ?>
0, 'title_li' => __(''), 'title_before' => '', 'title_after' => '', 'order' => $order, 'orderby' => $text, 'limit' => $limit, 'category' => $category, 'before' => '
  • ', 'echo' => false ); echo ''."\n"; //echo $ts; } ?>