Changeset 12965 for trunk/wp-admin/includes/ms.php
- Timestamp:
- 02/05/2010 02:00:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r12955 r12965 615 615 616 616 function admin_notice_feed() { 617 global $current_user ;618 if ( substr( $_SERVER[ 'PHP_SELF' ], -19 ) != '/wp-admin/index.php' )617 global $current_user, $current_screen; 618 if ( $current_screen->id != 'index' ) 619 619 return; 620 620 621 if ( isset( $_GET[ 'feed_dismiss' ] ) )621 if ( !empty( $_GET[ 'feed_dismiss' ] ) ) 622 622 update_user_option( $current_user->id, 'admin_feed_dismiss', $_GET[ 'feed_dismiss' ], true ); 623 623 624 624 $url = get_site_option( 'admin_notice_feed' ); 625 if ( $url == '')625 if ( empty( $url ) ) 626 626 return; 627 627 628 $rss = @fetch_feed( $url ); 629 $item = $rss->get_item(); 630 if ( !is_null( $item ) ) { 628 $rss = fetch_feed( $url ); 629 if ( ! is_wp_error( $rss ) && $item = $rss->get_item() ) { 631 630 $title = $item->get_title(); 632 if ( md5( $title ) == get_user_option( 'admin_feed_dismiss' , $current_user->id) )631 if ( md5( $title ) == get_user_option( 'admin_feed_dismiss' ) ) 633 632 return; 634 633 $msg = "<h3>" . esc_html( $title ) . "</h3>\n"; 635 634 $content = $item->get_description(); 636 if ( is_null( $content ) ) 637 $content = __( 'something' ); 638 639 $content = wp_html_excerpt($content, 200) . ' ...'; 640 $link = clean_url( strip_tags( $item->get_link() ) ); 641 $msg .= "<p>" . $content . " <a href='$link'>" . __( 'Read More' ) . "</a> <a href='index.php?feed_dismiss=" . md5( $title ) . "'>" . __( "Dismiss" ) . "</a></p>"; 635 $content = $content ? wp_html_excerpt( $content, 200 ) . ' … ' : ''; 636 $link = esc_url( strip_tags( $item->get_link() ) ); 637 $msg .= "<p>" . $content . "<a href='$link'>" . __( 'Read More' ) . "</a> <a href='index.php?feed_dismiss=" . md5( $title ) . "'>" . __( 'Dismiss' ) . "</a></p>"; 642 638 echo "<div class='updated fade'>$msg</div>"; 643 639 } elseif ( is_super_admin() ) { 644 printf( "<div id='update-nag'>" . __("Your feed at %s is empty.") . "</div>", wp_specialchars( $url ));640 printf( '<div id="update-nag">' . __( 'Your feed at %s is empty.' ) . '</div>', esc_html( $url ) ); 645 641 } 646 642 }
Note: See TracChangeset
for help on using the changeset viewer.