Make WordPress Core

Ticket #20130: 20130.diff

File 20130.diff, 10.5 KB (added by solarissmoke, 13 years ago)
  • wp-includes/bookmark-template.php

     
    2020 * used by themes.
    2121 *
    2222 * The defaults for overwriting are:
    23  * 'show_updated' - Default is 0 (integer). Will show the time of when the
    24  *              bookmark was last updated.
    2523 * 'show_description' - Default is 0 (integer). Whether to show the description
    2624 *              of the bookmark.
    2725 * 'show_images' - Default is 1 (integer). Whether to show link image if
     
    5048 */
    5149function _walk_bookmarks($bookmarks, $args = '' ) {
    5250        $defaults = array(
    53                 'show_updated' => 0, 'show_description' => 0,
     51                'show_description' => 0,
    5452                'show_images' => 1, 'show_name' => 0,
    5553                'before' => '<li>', 'after' => '</li>', 'between' => "\n",
    5654                'show_rating' => 0, 'link_before' => '', 'link_after' => ''
     
    6260        $output = ''; // Blank string to start with.
    6361
    6462        foreach ( (array) $bookmarks as $bookmark ) {
    65                 if ( !isset($bookmark->recently_updated) )
    66                         $bookmark->recently_updated = false;
    6763                $output .= $before;
    68                 if ( $show_updated && $bookmark->recently_updated )
    69                         $output .= get_option('links_recently_updated_prepend');
    7064
    7165                $the_link = '#';
    7266                if ( !empty($bookmark->link_url) )
     
    7670                $name = esc_attr(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display'));
    7771                $title = $desc;
    7872
    79                 if ( $show_updated )
    80                         if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) {
    81                                 $title .= ' (';
    82                                 $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600)));
    83                                 $title .= ')';
    84                         }
    85 
    8673                $alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"';
    8774
    8875                if ( '' != $title )
     
    116103
    117104                $output .= '</a>';
    118105
    119                 if ( $show_updated && $bookmark->recently_updated )
    120                         $output .= get_option('links_recently_updated_append');
    121 
    122106                if ( $show_description && '' != $desc )
    123107                        $output .= $between . $desc;
    124108
     
    147131 *              name.
    148132 * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide
    149133 *              links marked as 'invisible'.
    150  * 'show_updated' - Default is 0 (integer). Will show the time of when the
    151  *              bookmark was last updated.
    152134 * 'echo' - Default is 1 (integer). Whether to echo (default) or return the
    153135 *              formatted bookmarks.
    154136 * 'categorize' - Default is 1 (integer). Whether to show links listed by
     
    202184                'orderby' => 'name', 'order' => 'ASC',
    203185                'limit' => -1, 'category' => '', 'exclude_category' => '',
    204186                'category_name' => '', 'hide_invisible' => 1,
    205                 'show_updated' => 0, 'echo' => 1,
     187                'echo' => 1,
    206188                'categorize' => 1, 'title_li' => __('Bookmarks'),
    207189                'title_before' => '<h2>', 'title_after' => '</h2>',
    208190                'category_orderby' => 'name', 'category_order' => 'ASC',
  • wp-includes/bookmark.php

     
    120120                'orderby' => 'name', 'order' => 'ASC',
    121121                'limit' => -1, 'category' => '',
    122122                'category_name' => '', 'hide_invisible' => 1,
    123                 'show_updated' => 0, 'include' => '',
     123                'include' => '',
    124124                'exclude' => '', 'search' => ''
    125125        );
    126126
     
    203203                $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id";
    204204        }
    205205
    206         if ( $show_updated && get_option('links_recently_updated_time') ) {
    207                 $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated ";
    208         } else {
    209                 $recently_updated_test = '';
    210         }
    211 
    212         $get_updated = ( $show_updated ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
    213 
    214206        $orderby = strtolower($orderby);
    215207        $length = '';
    216208        switch ( $orderby ) {
     
    247239        if ( $hide_invisible )
    248240                $visible = "AND link_visible = 'Y'";
    249241
    250         $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query";
     242        $query = "SELECT * $length FROM $wpdb->links $join WHERE 1=1 $visible $category_query";
    251243        $query .= " $exclusions $inclusions $search";
    252244        $query .= " ORDER BY $orderby $order";
    253245        if ($limit != -1)
  • wp-includes/deprecated.php

     
    941941 * @param bool $show_description whether to show the description if show_images=false/not defined.
    942942 * @param bool $show_rating show rating stars/chars
    943943 * @param int $limit Limit to X entries. If not specified, all entries are shown.
    944  * @param int $show_updated whether to show last updated timestamp
    945944 * @param bool $echo whether to echo the results, or return them instead
    946945 * @return null|string
    947946 */
    948947function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name',
    949                         $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) {
     948                        $show_description = true, $show_rating = false, $limit = -1, $deprecated = null, $echo = true) {
    950949        _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' );
    951950
    952951        $order = 'ASC';
     
    958957        if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
    959958                $category = '';
    960959
    961         $results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit));
     960        $results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'limit' => $limit));
    962961
    963962        if ( !$results )
    964963                return;
     
    966965        $output = '';
    967966
    968967        foreach ( (array) $results as $row ) {
    969                 if ( !isset($row->recently_updated) )
    970                         $row->recently_updated = false;
    971968                $output .= $before;
    972                 if ( $show_updated && $row->recently_updated )
    973                         $output .= get_option('links_recently_updated_prepend');
    974969                $the_link = '#';
    975970                if ( !empty($row->link_url) )
    976971                        $the_link = esc_url($row->link_url);
     
    982977                $name = esc_attr(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display'));
    983978                $title = $desc;
    984979
    985                 if ( $show_updated )
    986                         if (substr($row->link_updated_f, 0, 2) != '00')
    987                                 $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')';
    988 
    989980                if ( '' != $title )
    990981                        $title = ' title="' . $title . '"';
    991982
     
    1008999
    10091000                $output .= '</a>';
    10101001
    1011                 if ( $show_updated && $row->recently_updated )
    1012                         $output .= get_option('links_recently_updated_append');
    1013 
    10141002                if ( $show_description && '' != $desc )
    10151003                        $output .= $between . $desc;
    10161004
  • wp-admin/includes/schema.php

     
    391391        'date_format' => __('F j, Y'),
    392392        /* translators: default time format, see http://php.net/date */
    393393        'time_format' => __('g:i a'),
    394         /* translators: links last updated date format, see http://php.net/date */
    395         'links_updated_date_format' => __('F j, Y g:i a'),
    396         'links_recently_updated_prepend' => '<em>',
    397         'links_recently_updated_append' => '</em>',
    398         'links_recently_updated_time' => 120,
    399394        'comment_moderation' => 0,
    400395        'moderation_notify' => 1,
    401396        'permalink_structure' => '',
     
    533528        if ( !__get_option('home') ) update_option('home', $guessurl);
    534529
    535530        // Delete unused options
    536         $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', 'wporg_popular_tags', 'what_to_show', 'rss_language');
     531        $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page', 'wporg_popular_tags', 'what_to_show', 'rss_language', 'links_updated_date_format', 'links_recently_updated_prepend', 'links_recently_updated_append', 'links_recently_updated_time' );
    537532        foreach ( $unusedoptions as $option )
    538533                delete_option($option);
    539534