Make WordPress Core

Ticket #7661: 7661.r8933.diff

File 7661.r8933.diff, 3.8 KB (added by jacobsantos, 15 years ago)

Partially complete inline documentation for widgets.php based off r8933

  • widgets.php

     
    575575        echo '</div>';
    576576        echo $after_widget;
    577577}
     578
    578579function wp_widget_calendar_control() {
    579580        $options = $newoptions = get_option('widget_calendar');
    580581        if ( $_POST["calendar-submit"] ) {
     
    931932                wp_cache_add('widget_recent_entries', ob_get_flush(), 'widget');
    932933}
    933934
     935/**
     936 * Remove recent entries widget items cache.
     937 *
     938 * @since unknown
     939 */
    934940function wp_flush_widget_recent_entries() {
    935941        wp_cache_delete('widget_recent_entries', 'widget');
    936942}
     
    993999<?php
    9941000}
    9951001
     1002/**
     1003 * Remove the cache for recent comments widget.
     1004 *
     1005 * @since unknown
     1006 */
    9961007function wp_delete_recent_comments_cache() {
    9971008        wp_cache_delete( 'recent_comments', 'widget' );
    9981009}
     
    10241035<?php
    10251036}
    10261037
     1038/**
     1039 * Display the style for recent comments widget.
     1040 *
     1041 * @since unknown
     1042 */
    10271043function wp_widget_recent_comments_style() {
    10281044?>
    10291045<style type="text/css">.recentcomments a{display:inline !important;padding: 0 !important;margin: 0 !important;}</style>
     
    12371253        wp_widget_rss_form( compact( 'number', 'title', 'url', 'items', 'error', 'show_summary', 'show_author', 'show_date' ) );
    12381254}
    12391255
     1256/**
     1257 * Display RSS widget options form.
     1258 *
     1259 * The options for what fields are displayed for the RSS form are all booleans
     1260 * and are as follows: 'url', 'title', 'items', 'show_summary', 'show_author',
     1261 * 'show_date'.
     1262 *
     1263 * @since unknown
     1264 *
     1265 * @param array|string $args Values for input fields.
     1266 * @param array $inputs Override default display options.
     1267 */
    12401268function wp_widget_rss_form( $args, $inputs = null ) {
    12411269        $default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true );
    12421270        $inputs = wp_parse_args( $inputs, $default_inputs );
     
    13091337        endforeach;
    13101338}
    13111339
    1312 // Expects unescaped data
     1340/**
     1341 * Process RSS feed widget data and optionally retrieve feed items.
     1342 *
     1343 * The feed widget can not have more than 20 items or it will reset back to the
     1344 * default, which is 10.
     1345 *
     1346 * The resulting array has the feed title, feed url, feed link (from channel),
     1347 * feed items, error (if any), and whether to show summary, author, and date.
     1348 * All respectively in the order of the array elements.
     1349 *
     1350 * @since unknown
     1351 *
     1352 * @param array $widget_rss RSS widget feed data. Expects unescaped data.
     1353 * @param bool $check_feed Optional, default is true. Whether to check feed for errors.
     1354 * @return array
     1355 */
    13131356function wp_widget_rss_process( $widget_rss, $check_feed = true ) {
    13141357        $items = (int) $widget_rss['items'];
    13151358        if ( $items < 1 || 20 < $items )
     
    13381381        return compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' );
    13391382}
    13401383
     1384/**
     1385 * Register RSS widget to allow multiple RSS widgets.
     1386 *
     1387 * @since unknown
     1388 */
    13411389function wp_widget_rss_register() {
    13421390        if ( !$options = get_option('widget_rss') )
    13431391                $options = array();
     
    13621410        }
    13631411}
    13641412
     1413/**
     1414 * Display tag cloud WordPress widget.
     1415 *
     1416 * @since unknown
     1417 *
     1418 * @param array $args Widget arguments.
     1419 */
    13651420function wp_widget_tag_cloud($args) {
    13661421        extract($args);
    13671422        $options = get_option('widget_tag_cloud');
     
    13731428        echo $after_widget;
    13741429}
    13751430
     1431/**
     1432 * Manage WordPress Tag Cloud widget options.
     1433 *
     1434 * Displays management form for changing the tag cloud widget title.
     1435 *
     1436 * @since unknown
     1437 */
    13761438function wp_widget_tag_cloud_control() {
    13771439        $options = $newoptions = get_option('widget_tag_cloud');
    13781440
     
    13941456<?php
    13951457}
    13961458
     1459/**
     1460 * Register all of the default WordPress widgets.
     1461 *
     1462 * Calls 'widgets_init' action after all of the WordPress widgets have been
     1463 * registered.
     1464 *
     1465 * @since unknown
     1466 */
    13971467function wp_widgets_init() {
    13981468        if ( !is_blog_installed() )
    13991469                return;