Changeset 35848
- Timestamp:
- 12/10/2015 03:05:34 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r35796 r35848 20 20 'rtl.css' => __( 'RTL Stylesheet' ), 21 21 'comments.php' => __( 'Comments' ), 22 'comments-popup.php' => __( 'Popup Comments' ),23 22 'footer.php' => __( 'Theme Footer' ), 24 23 'header.php' => __( 'Theme Header' ), … … 46 45 'wp-comments.php' => __( 'Comments Template' ), 47 46 'wp-comments-popup.php' => __( 'Popup Comments Template' ), 47 'comments-popup.php' => __( 'Popup Comments' ), 48 48 ); 49 49 -
trunk/src/wp-admin/includes/update-core.php
r35738 r35848 701 701 'wp-includes/js/tinymce/wp-mce-help.php', 702 702 'wp-includes/js/tinymce/plugins/wpfullscreen', 703 // 4.5 704 'wp-includes/theme-compat/comments-popup.php', 703 705 ); 704 706 -
trunk/src/wp-includes/canonical.php
r35770 r35848 18 18 * one or the other. 19 19 * 20 * Prevents redirection for feeds, trackbacks, searches, comment popup,and20 * Prevents redirection for feeds, trackbacks, searches, and 21 21 * admin URLs. Does not redirect on non-pretty-permalink-supporting IIS 7+, 22 22 * page/post previews, WP admin, Trackbacks, robots.txt, searches, or on POST … … 56 56 } 57 57 58 if ( is_trackback() || is_search() || is_ comments_popup() || is_admin() || is_preview() || is_robots() || ( $is_IIS && !iis7_supports_permalinks() ) ) {58 if ( is_trackback() || is_search() || is_admin() || is_preview() || is_robots() || ( $is_IIS && !iis7_supports_permalinks() ) ) { 59 59 return; 60 60 } -
trunk/src/wp-includes/class-wp.php
r35436 r35848 16 16 * @var array 17 17 */ 18 public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', ' comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'title', 'embed' );18 public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'title', 'embed' ); 19 19 20 20 /** -
trunk/src/wp-includes/comment-template.php
r35748 r35848 1389 1389 1390 1390 /** 1391 * Display the JS popup script to show a comment. 1392 * 1393 * If the $file parameter is empty, then the home page is assumed. The defaults 1394 * for the window are 400px by 400px. 1395 * 1396 * For the comment link popup to work, this function has to be called or the 1397 * normal comment link will be assumed. 1398 * 1399 * @global string $wpcommentspopupfile The URL to use for the popup window. 1400 * @global int $wpcommentsjavascript Whether to use JavaScript. Set when function is called. 1401 * 1402 * @since 0.71 1403 * 1404 * @param int $width Optional. The width of the popup window. Default 400. 1405 * @param int $height Optional. The height of the popup window. Default 400. 1406 * @param string $file Optional. Sets the location of the popup window. 1407 */ 1408 function comments_popup_script( $width = 400, $height = 400, $file = '' ) { 1409 global $wpcommentspopupfile, $wpcommentsjavascript; 1410 1411 if (empty ($file)) { 1412 $wpcommentspopupfile = ''; // Use the index. 1413 } else { 1414 $wpcommentspopupfile = $file; 1415 } 1416 1417 $wpcommentsjavascript = 1; 1418 $javascript = "<script type='text/javascript'>\nfunction wpopen (macagna) {\n window.open(macagna, '_blank', 'width=$width,height=$height,scrollbars=yes,status=yes');\n}\n</script>\n"; 1419 echo $javascript; 1420 } 1421 1422 /** 1423 * Displays the link to the comments popup window for the current post ID. 1424 * 1425 * Is not meant to be displayed on single posts and pages. Should be used 1426 * on the lists of posts 1427 * 1428 * @global string $wpcommentspopupfile The URL to use for the popup window. 1429 * @global int $wpcommentsjavascript Whether to use JavaScript. Set when function is called. 1391 * Displays the link to the comments for the current post ID. 1430 1392 * 1431 1393 * @since 0.71 … … 1441 1403 */ 1442 1404 function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) { 1443 global $wpcommentspopupfile, $wpcommentsjavascript;1444 1445 1405 $id = get_the_ID(); 1446 1406 $title = get_the_title(); … … 1479 1439 1480 1440 echo '<a href="'; 1481 if ( $wpcommentsjavascript ) { 1482 if ( empty( $wpcommentspopupfile ) ) 1483 $home = home_url(); 1484 else 1485 $home = get_option('siteurl'); 1486 echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id; 1487 echo '" onclick="wpopen(this.href); return false"'; 1441 if ( 0 == $number ) { 1442 $respond_link = get_permalink() . '#respond'; 1443 /** 1444 * Filter the respond link when a post has no comments. 1445 * 1446 * @since 4.4.0 1447 * 1448 * @param string $respond_link The default response link. 1449 * @param integer $id The post ID. 1450 */ 1451 echo apply_filters( 'respond_link', $respond_link, $id ); 1488 1452 } else { 1489 // if comments_popup_script() is not in the template, display simple comment link 1490 if ( 0 == $number ) { 1491 $respond_link = get_permalink() . '#respond'; 1492 /** 1493 * Filter the respond link when a post has no comments. 1494 * 1495 * @since 4.4.0 1496 * 1497 * @param string $respond_link The default response link. 1498 * @param integer $id The post ID. 1499 */ 1500 echo apply_filters( 'respond_link', $respond_link, $id ); 1501 } else { 1502 comments_link(); 1503 } 1504 echo '"'; 1505 } 1453 comments_link(); 1454 } 1455 echo '"'; 1506 1456 1507 1457 if ( !empty( $css_class ) ) { … … 1511 1461 $attributes = ''; 1512 1462 /** 1513 * Filter the comments popuplink attributes for display.1463 * Filter the comments link attributes for display. 1514 1464 * 1515 1465 * @since 2.5.0 1516 1466 * 1517 * @param string $attributes The comments popuplink attributes. Default empty.1467 * @param string $attributes The comments link attributes. Default empty. 1518 1468 */ 1519 1469 echo apply_filters( 'comments_popup_link_attributes', $attributes ); -
trunk/src/wp-includes/deprecated.php
r35624 r35848 3636 3636 return force_ssl_admin( $force ); 3637 3637 } 3638 3639 /** 3640 * Retrieve path of comment popup template in current or parent template. 3641 * 3642 * @since 1.5.0 3643 * @deprecated 4.5.0 3644 * 3645 * @return string Full path to comments popup template file. 3646 */ 3647 function get_comments_popup_template() { 3648 _deprecated_function( __FUNCTION__, '4.5' ); 3649 3650 return ''; 3651 } 3652 3653 /** 3654 * Whether the current URL is within the comments popup window. 3655 * 3656 * @since 1.5.0 3657 * @deprecated 4.5.0 3658 * 3659 * @return bool 3660 */ 3661 function is_comments_popup() { 3662 _deprecated_function( __FUNCTION__, '4.5' ); 3663 3664 return false; 3665 } 3666 3667 /** 3668 * Display the JS popup script to show a comment. 3669 * 3670 * @since 0.71 3671 * @deprecated 4.5.0 3672 */ 3673 function comments_popup_script() { 3674 _deprecated_function( __FUNCTION__, '4.5' ); 3675 } 3676 3677 /** 3678 * Adds element attributes to open links in new windows. 3679 * 3680 * @since 0.71 3681 * @deprecated 4.5.0 3682 * 3683 * @param string $text Content to replace links to open in a new window. 3684 * @return string Content that has filtered links. 3685 */ 3686 function popuplinks( $text ) { 3687 _deprecated_function( __FUNCTION__, '4.5' ); 3688 $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text); 3689 return $text; 3690 } -
trunk/src/wp-includes/formatting.php
r35847 r35848 2690 2690 return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string); 2691 2691 } 2692 }2693 2694 /**2695 * Adds a element attributes to open links in new windows.2696 *2697 * Comment text in popup windows should be filtered through this. Right now it's2698 * a moderately dumb function, ideally it would detect whether a target or rel2699 * attribute was already there and adjust its actions accordingly.2700 *2701 * @since 0.712702 *2703 * @param string $text Content to replace links to open in a new window.2704 * @return string Content that has filtered links.2705 */2706 function popuplinks( $text ) {2707 $text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);2708 return $text;2709 2692 } 2710 2693 -
trunk/src/wp-includes/query.php
r35690 r35848 295 295 296 296 return $wp_query->is_tax( $taxonomy, $term ); 297 }298 299 /**300 * Whether the current URL is within the comments popup window.301 *302 * @since 1.5.0303 *304 * @global WP_Query $wp_query Global WP_Query instance.305 *306 * @return bool307 */308 function is_comments_popup() {309 global $wp_query;310 311 if ( ! isset( $wp_query ) ) {312 _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );313 return false;314 }315 316 return $wp_query->is_comments_popup();317 297 } 318 298 … … 863 843 * 864 844 * @since 1.5.0 845 * @since 4.5.0 Removed the `$comments_popup` property. 865 846 */ 866 847 class WP_Query { … … 1229 1210 */ 1230 1211 public $is_embed = false; 1231 1232 /**1233 * Set if query is within comments popup window.1234 *1235 * @since 1.5.01236 * @access public1237 * @var bool1238 */1239 public $is_comments_popup = false;1240 1212 1241 1213 /** … … 1390 1362 $this->is_home = false; 1391 1363 $this->is_404 = false; 1392 $this->is_comments_popup = false;1393 1364 $this->is_paged = false; 1394 1365 $this->is_admin = false; … … 1442 1413 * 1443 1414 * @since 2.1.0 1415 * @since 4.4.0 Removed the `comments_popup` public query variable. 1444 1416 * @access public 1445 1417 * … … 1477 1449 , 'tb' 1478 1450 , 'paged' 1479 , 'comments_popup'1480 1451 , 'meta_key' 1481 1452 , 'meta_value' … … 1512 1483 * @since 4.4.0 Introduced `$post_name__in` and `$title` parameters. `$s` was updated to support excluded 1513 1484 * search terms, by prepending a hyphen. 1485 * @since 4.5.0 Removed the `$comments_popup` parameter. 1514 1486 * @access public 1515 1487 * … … 1530 1502 * @type int $comments_per_page The number of comments to return per page. 1531 1503 * Default 'comments_per_page' option. 1532 * @type int|string $comments_popup Whether the query is within the comments popup. Default empty.1533 1504 * @type array $date_query An associative array of WP_Date_Query arguments. 1534 1505 * {@see WP_Date_Query::__construct()} … … 1792 1763 $this->is_paged = true; 1793 1764 1794 if ( '' != $qv['comments_popup'] )1795 $this->is_comments_popup = true;1796 1797 1765 // if we're previewing inside the write screen 1798 1766 if ( '' != $qv['preview'] ) … … 1812 1780 $this->is_comment_feed = true; 1813 1781 1814 if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_ comments_popup || $this->is_robots ) )1782 if ( !( $this->is_singular || $this->is_archive || $this->is_search || $this->is_feed || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) || $this->is_trackback || $this->is_404 || $this->is_admin || $this->is_robots ) ) 1815 1783 $this->is_home = true; 1816 1784 … … 2772 2740 } 2773 2741 2774 if ( intval($q['comments_popup']) )2775 $q['p'] = absint($q['comments_popup']);2776 2777 2742 // If an attachment is requested by number, let it supersede any post number. 2778 2743 if ( $q['attachment_id'] ) … … 4385 4350 * 4386 4351 * @since 3.1.0 4352 * @deprecated 4.5.0 4387 4353 * 4388 4354 * @return bool 4389 4355 */ 4390 4356 public function is_comments_popup() { 4391 return (bool) $this->is_comments_popup; 4357 _deprecated_function( __FUNCTION__, '4.5' ); 4358 4359 return false; 4392 4360 } 4393 4361 -
trunk/src/wp-includes/template-loader.php
r34903 r35848 74 74 elseif ( is_date() && $template = get_date_template() ) : 75 75 elseif ( is_archive() && $template = get_archive_template() ) : 76 elseif ( is_comments_popup() && $template = get_comments_popup_template() ) :77 76 elseif ( is_paged() && $template = get_paged_template() ) : 78 77 else : -
trunk/src/wp-includes/template.php
r35413 r35848 467 467 468 468 /** 469 * Retrieve path of comment popup template in current or parent template.470 *471 * Checks for comment popup template in current template, if it exists or in the472 * parent template.473 *474 * The template path is filterable via the dynamic {@see '$type_template'} hook,475 * e.g. 'commentspopup_template'.476 *477 * @since 1.5.0478 *479 * @see get_query_template()480 *481 * @return string Full path to comments popup template file.482 */483 function get_comments_popup_template() {484 $template = get_query_template( 'comments_popup', array( 'comments-popup.php' ) );485 486 // Backward compat code will be removed in a future release.487 if ('' == $template)488 $template = ABSPATH . WPINC . '/theme-compat/comments-popup.php';489 490 return $template;491 }492 493 /**494 469 * Retrieve the name of the highest priority template file that exists. 495 470 *
Note: See TracChangeset
for help on using the changeset viewer.