Changeset 57357
- Timestamp:
- 01/25/2024 05:34:54 PM (9 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r57318 r57357 551 551 552 552 if ( is_attachment() && ! get_option( 'wp_attachment_pages_enabled' ) ) { 553 $attachment_id = get_query_var( 'attachment_id' ); 554 555 if ( current_user_can( 'read_post', $attachment_id ) ) { 556 $redirect_url = wp_get_attachment_url( $attachment_id ); 557 558 $is_attachment_redirect = true; 559 } 553 $attachment_id = get_query_var( 'attachment_id' ); 554 $attachment_post = get_post( $attachment_id ); 555 $attachment_parent_id = $attachment_post ? $attachment_post->post_parent : 0; 556 557 $attachment_url = wp_get_attachment_url( $attachment_id ); 558 if ( $attachment_url !== $redirect_url ) { 559 /* 560 * If an attachment is attached to a post, it inherits the parent post's status. Fetch the 561 * parent post to check its status later. 562 */ 563 if ( $attachment_parent_id ) { 564 $redirect_obj = get_post( $attachment_parent_id ); 565 } 566 $redirect_url = $attachment_url; 567 } 568 569 $is_attachment_redirect = true; 560 570 } 561 571 -
trunk/tests/phpunit/tests/canonical.php
r57318 r57357 15 15 wp_set_current_user( self::$author_id ); 16 16 17 add_filter( 'pre_option_wp_attachment_pages_enabled', '__return_true');17 update_option( 'wp_attachment_pages_enabled', 1 ); 18 18 } 19 19 … … 408 408 409 409 /** 410 * Test canonical redirects for attachment pages when the option is disabled. 411 * 410 412 * @ticket 57913 411 */ 412 public function test_canonical_attachment_page_redirect_with_option_disabled() { 413 add_filter( 'pre_option_wp_attachment_pages_enabled', '__return_false' ); 413 * @ticket 59866 414 * 415 * @dataProvider data_canonical_attachment_page_redirect_with_option_disabled 416 */ 417 public function test_canonical_attachment_page_redirect_with_option_disabled( $expected, $user = null, $parent_post_status = '' ) { 418 update_option( 'wp_attachment_pages_enabled', 0 ); 419 420 if ( '' !== $parent_post_status ) { 421 $parent_post_id = self::factory()->post->create( 422 array( 423 'post_status' => $parent_post_status, 424 ) 425 ); 426 } else { 427 $parent_post_id = 0; 428 } 414 429 415 430 $filename = DIR_TESTDATA . '/images/test-image.jpg'; … … 417 432 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 418 433 419 $attachment_id = $this->_make_attachment( $upload ); 434 $attachment_id = $this->_make_attachment( $upload, $parent_post_id ); 435 $attachment_url = wp_get_attachment_url( $attachment_id ); 420 436 $attachment_page = get_permalink( $attachment_id ); 421 437 438 // Set as anonymous/logged out user. 439 if ( null !== $user ) { 440 wp_set_current_user( $user ); 441 } 442 422 443 $this->go_to( $attachment_page ); 423 444 424 $url = redirect_canonical( $attachment_page, false ); 425 $expected = wp_get_attachment_url( $attachment_id ); 445 $url = redirect_canonical( $attachment_page, false ); 446 if ( is_string( $expected ) ) { 447 $expected = str_replace( '%%attachment_url%%', $attachment_url, $expected ); 448 } 426 449 427 450 $this->assertSame( $expected, $url ); 428 451 } 452 453 /** 454 * Data provider for test_canonical_attachment_page_redirect_with_option_disabled(). 455 * 456 * @return array[] 457 */ 458 public function data_canonical_attachment_page_redirect_with_option_disabled() { 459 return array( 460 'logged out user, no parent' => array( 461 '%%attachment_url%%', 462 0, 463 ), 464 'logged in user, no parent' => array( 465 '%%attachment_url%%', 466 ), 467 'logged out user, private parent' => array( 468 null, 469 0, 470 'private', 471 ), 472 'logged in user, private parent' => array( 473 '%%attachment_url%%', 474 null, 475 'private', 476 ), 477 'logged out user, public parent' => array( 478 '%%attachment_url%%', 479 0, 480 'publish', 481 ), 482 'logged in user, public parent' => array( 483 '%%attachment_url%%', 484 null, 485 'publish', 486 ), 487 ); 488 } 429 489 } -
trunk/tests/phpunit/tests/canonical/postStatus.php
r56657 r57357 170 170 parent::set_up(); 171 171 self::setup_custom_types(); 172 173 add_filter( 'pre_option_wp_attachment_pages_enabled', '__return_true' );174 172 } 175 173 … … 224 222 * @param string $requested Requested URL. 225 223 * @param string $expected Expected URL. 224 * @param string $enable_attachment_pages Whether to enable attachment pages. Default true. 226 225 */ 227 public function test_canonical_redirects_to_plain_permalinks( $post_key, $user_role, $requested, $expected ) { 226 public function test_canonical_redirects_to_plain_permalinks( $post_key, $user_role, $requested, $expected, $enable_attachment_pages = true ) { 227 if ( $enable_attachment_pages ) { 228 update_option( 'wp_attachment_pages_enabled', 1 ); 229 } else { 230 update_option( 'wp_attachment_pages_enabled', 0 ); 231 } 232 228 233 wp_set_current_user( self::$users[ $user_role ] ); 229 234 $this->set_permalink_structure( '' ); … … 244 249 * Data provider for test_canonical_redirects_to_plain_permalinks. 245 250 * 246 * @return array[] Array of arguments for tests { 247 * @type string $post_key Post key used for creating fixtures. 248 * @type string $user_role User role. 249 * @type string $requested Requested URL. 250 * @type string $expected Expected URL. 251 * } 251 * @return array[] 252 252 */ 253 253 public function data_canonical_redirects_to_plain_permalinks() { … … 274 274 '/?post_type=page&p=%ID%', 275 275 '/?post_type=page&p=%ID%', 276 ); 277 278 $data[] = array( 279 $post_key, 280 $user, 281 "/?name=$post_key-post", 282 "/?name=$post_key-post", 276 true, 277 ); 278 279 $data[] = array( 280 "$post_key-page", 281 $user, 282 '/?post_type=page&p=%ID%', 283 '/?post_type=page&p=%ID%', 284 false, 285 ); 286 287 $data[] = array( 288 $post_key, 289 $user, 290 "/?name=$post_key-post", 291 "/?name=$post_key-post", 292 true, 293 ); 294 295 $data[] = array( 296 $post_key, 297 $user, 298 "/?name=$post_key-post", 299 "/?name=$post_key-post", 300 false, 283 301 ); 284 302 … … 289 307 '/?feed=rss&p=%ID%', 290 308 '/?feed=rss2&p=%ID%', 309 true, 310 ); 311 312 $data[] = array( 313 $post_key, 314 $user, 315 '/?feed=rss&p=%ID%', 316 '/?feed=rss2&p=%ID%', 317 false, 291 318 ); 292 319 … … 297 324 '/?feed=rss&page_id=%ID%', 298 325 '/?feed=rss2&page_id=%ID%', 326 true, 327 ); 328 329 $data[] = array( 330 "$post_key-page", 331 $user, 332 '/?feed=rss&page_id=%ID%', 333 '/?feed=rss2&page_id=%ID%', 334 false, 299 335 ); 300 336 } … … 312 348 '/?post_type=page&p=%ID%', 313 349 '/?post_type=page&p=%ID%', 314 ); 315 316 $data[] = array( 317 $post_key, 318 $user, 319 "/?name=$post_key-post", 320 "/?name=$post_key-post", 350 true, 351 ); 352 353 $data[] = array( 354 "$post_key-page", 355 $user, 356 '/?post_type=page&p=%ID%', 357 '/?post_type=page&p=%ID%', 358 false, 359 ); 360 361 $data[] = array( 362 $post_key, 363 $user, 364 "/?name=$post_key-post", 365 "/?name=$post_key-post", 366 true, 367 ); 368 369 $data[] = array( 370 $post_key, 371 $user, 372 "/?name=$post_key-post", 373 "/?name=$post_key-post", 374 false, 321 375 ); 322 376 … … 327 381 '/?feed=rss&p=%ID%', 328 382 '/?feed=rss2&p=%ID%', 383 true, 384 ); 385 386 $data[] = array( 387 $post_key, 388 $user, 389 '/?feed=rss&p=%ID%', 390 '/?feed=rss2&p=%ID%', 391 false, 329 392 ); 330 393 … … 335 398 '/?feed=rss&page_id=%ID%', 336 399 '/?feed=rss2&page_id=%ID%', 400 true, 401 ); 402 403 $data[] = array( 404 "$post_key-page", 405 $user, 406 '/?feed=rss&page_id=%ID%', 407 '/?feed=rss2&page_id=%ID%', 408 false, 337 409 ); 338 410 } … … 348 420 '/?post_type=page&p=%ID%', 349 421 '/?post_type=page&p=%ID%', 350 ); 351 352 $data[] = array( 353 $post_key, 354 $user, 355 "/?name=$post_key-post", 356 "/?name=$post_key-post", 422 true, 423 ); 424 425 $data[] = array( 426 "$post_key-page", 427 $user, 428 '/?post_type=page&p=%ID%', 429 '/?post_type=page&p=%ID%', 430 false, 431 ); 432 433 $data[] = array( 434 $post_key, 435 $user, 436 "/?name=$post_key-post", 437 "/?name=$post_key-post", 438 true, 439 ); 440 441 $data[] = array( 442 $post_key, 443 $user, 444 "/?name=$post_key-post", 445 "/?name=$post_key-post", 446 false, 357 447 ); 358 448 … … 363 453 '/?feed=rss&p=%ID%', 364 454 '/?feed=rss&p=%ID%', 455 true, 456 ); 457 458 $data[] = array( 459 $post_key, 460 $user, 461 '/?feed=rss&p=%ID%', 462 '/?feed=rss&p=%ID%', 463 false, 365 464 ); 366 465 … … 371 470 '/?feed=rss&page_id=%ID%', 372 471 '/?feed=rss&page_id=%ID%', 472 true, 473 ); 474 475 $data[] = array( 476 "$post_key-page", 477 $user, 478 '/?feed=rss&page_id=%ID%', 479 '/?feed=rss&page_id=%ID%', 480 false, 373 481 ); 374 482 } … … 386 494 '/?post_type=page&p=%ID%', 387 495 '/?post_type=page&p=%ID%', 388 ); 389 390 $data[] = array( 391 $post_key, 392 $user, 393 "/?name=$post_key-post", 394 "/?name=$post_key-post", 496 true, 497 ); 498 499 $data[] = array( 500 "$post_key-page", 501 $user, 502 '/?post_type=page&p=%ID%', 503 '/?post_type=page&p=%ID%', 504 false, 505 ); 506 507 $data[] = array( 508 $post_key, 509 $user, 510 "/?name=$post_key-post", 511 "/?name=$post_key-post", 512 true, 513 ); 514 515 $data[] = array( 516 $post_key, 517 $user, 518 "/?name=$post_key-post", 519 "/?name=$post_key-post", 520 false, 395 521 ); 396 522 … … 401 527 '/?feed=rss&p=%ID%', 402 528 '/?feed=rss&p=%ID%', 529 true, 530 ); 531 532 $data[] = array( 533 $post_key, 534 $user, 535 '/?feed=rss&p=%ID%', 536 '/?feed=rss&p=%ID%', 537 false, 403 538 ); 404 539 … … 409 544 '/?feed=rss&page_id=%ID%', 410 545 '/?feed=rss&page_id=%ID%', 546 true, 547 ); 548 549 $data[] = array( 550 "$post_key-page", 551 $user, 552 '/?feed=rss&page_id=%ID%', 553 '/?feed=rss&page_id=%ID%', 554 false, 411 555 ); 412 556 } … … 424 568 '/?post_type=page&p=%ID%', 425 569 '/?post_type=page&p=%ID%', 426 ); 427 428 $data[] = array( 429 $post_key, 430 $user, 431 "/?name=$post_key-post", 432 "/?name=$post_key-post", 570 true, 571 ); 572 573 $data[] = array( 574 "$post_key-page", 575 $user, 576 '/?post_type=page&p=%ID%', 577 '/?post_type=page&p=%ID%', 578 false, 579 ); 580 581 $data[] = array( 582 $post_key, 583 $user, 584 "/?name=$post_key-post", 585 "/?name=$post_key-post", 586 true, 587 ); 588 589 $data[] = array( 590 $post_key, 591 $user, 592 "/?name=$post_key-post", 593 "/?name=$post_key-post", 594 false, 433 595 ); 434 596 … … 439 601 '/?feed=rss&p=%ID%', 440 602 '/?feed=rss&p=%ID%', 603 true, 604 ); 605 606 $data[] = array( 607 $post_key, 608 $user, 609 '/?feed=rss&p=%ID%', 610 '/?feed=rss&p=%ID%', 611 false, 441 612 ); 442 613 … … 447 618 '/?feed=rss&page_id=%ID%', 448 619 '/?feed=rss&page_id=%ID%', 620 true, 621 ); 622 623 $data[] = array( 624 "$post_key-page", 625 $user, 626 '/?feed=rss&page_id=%ID%', 627 '/?feed=rss&page_id=%ID%', 628 false, 449 629 ); 450 630 } … … 458 638 '/?p=%ID%', 459 639 '/?a-public-cpt=a-public-cpt', 460 ); 461 462 $data[] = array( 463 "$post_key-attachment", 464 $user, 465 '/?attachment_id=%ID%', 466 '/?attachment_id=%ID%', 467 ); 468 469 $data[] = array( 470 $post_key, 471 $user, 472 "/?name=$post_key&post_type=$post_key", 473 "/?name=$post_key&post_type=$post_key", 640 true, 641 ); 642 643 $data[] = array( 644 $post_key, 645 $user, 646 '/?p=%ID%', 647 '/?a-public-cpt=a-public-cpt', 648 false, 649 ); 650 651 $data[] = array( 652 "$post_key-attachment", 653 $user, 654 '/?attachment_id=%ID%', 655 '/?attachment_id=%ID%', 656 true, 657 ); 658 659 $data[] = array( 660 "$post_key-attachment", 661 $user, 662 '/?attachment_id=%ID%', 663 '/?attachment_id=%ID%', 664 false, 665 ); 666 667 $data[] = array( 668 $post_key, 669 $user, 670 "/?name=$post_key&post_type=$post_key", 671 "/?name=$post_key&post_type=$post_key", 672 true, 673 ); 674 675 $data[] = array( 676 $post_key, 677 $user, 678 "/?name=$post_key&post_type=$post_key", 679 "/?name=$post_key&post_type=$post_key", 680 false, 474 681 ); 475 682 … … 480 687 '/?feed=rss&p=%ID%', 481 688 '/?a-public-cpt=a-public-cpt&feed=rss2', 689 true, 690 ); 691 692 $data[] = array( 693 $post_key, 694 $user, 695 '/?feed=rss&p=%ID%', 696 '/?a-public-cpt=a-public-cpt&feed=rss2', 697 false, 482 698 ); 483 699 } … … 489 705 '/?p=%ID%', 490 706 '/?p=%ID%', 491 ); 492 493 $data[] = array( 494 "$post_key-attachment", 495 $user, 496 '/?attachment_id=%ID%', 497 '/?attachment_id=%ID%', 498 ); 499 500 $data[] = array( 501 $post_key, 502 $user, 503 "/?name=$post_key&post_type=$post_key", 504 "/?name=$post_key&post_type=$post_key", 707 true, 708 ); 709 710 $data[] = array( 711 $post_key, 712 $user, 713 '/?p=%ID%', 714 '/?p=%ID%', 715 false, 716 ); 717 718 $data[] = array( 719 "$post_key-attachment", 720 $user, 721 '/?attachment_id=%ID%', 722 '/?attachment_id=%ID%', 723 true, 724 ); 725 726 $data[] = array( 727 "$post_key-attachment", 728 $user, 729 '/?attachment_id=%ID%', 730 '/?attachment_id=%ID%', 731 false, 732 ); 733 734 $data[] = array( 735 $post_key, 736 $user, 737 "/?name=$post_key&post_type=$post_key", 738 "/?name=$post_key&post_type=$post_key", 739 true, 740 ); 741 742 $data[] = array( 743 $post_key, 744 $user, 745 "/?name=$post_key&post_type=$post_key", 746 "/?name=$post_key&post_type=$post_key", 747 false, 505 748 ); 506 749 … … 511 754 '/?feed=rss&p=%ID%', 512 755 '/?feed=rss&p=%ID%', 756 true, 757 ); 758 759 $data[] = array( 760 $post_key, 761 $user, 762 '/?feed=rss&p=%ID%', 763 '/?feed=rss&p=%ID%', 764 false, 513 765 ); 514 766 } … … 522 774 '/?p=%ID%', 523 775 '/?p=%ID%', 524 ); 525 526 $data[] = array( 527 "$post_key-attachment", 528 $user, 529 '/?attachment_id=%ID%', 530 '/?attachment_id=%ID%', 531 ); 532 533 $data[] = array( 534 $post_key, 535 $user, 536 "/?name=$post_key&post_type=$post_key", 537 "/?name=$post_key&post_type=$post_key", 538 ); 539 540 $data[] = array( 541 $post_key, 542 $user, 543 '/?feed=rss&p=%ID%', 544 '/?feed=rss&p=%ID%', 776 true, 777 ); 778 779 $data[] = array( 780 $post_key, 781 $user, 782 '/?p=%ID%', 783 '/?p=%ID%', 784 false, 785 ); 786 787 $data[] = array( 788 "$post_key-attachment", 789 $user, 790 '/?attachment_id=%ID%', 791 '/?attachment_id=%ID%', 792 true, 793 ); 794 795 $data[] = array( 796 "$post_key-attachment", 797 $user, 798 '/?attachment_id=%ID%', 799 '/?attachment_id=%ID%', 800 false, 801 ); 802 803 $data[] = array( 804 $post_key, 805 $user, 806 "/?name=$post_key&post_type=$post_key", 807 "/?name=$post_key&post_type=$post_key", 808 true, 809 ); 810 811 $data[] = array( 812 $post_key, 813 $user, 814 "/?name=$post_key&post_type=$post_key", 815 "/?name=$post_key&post_type=$post_key", 816 false, 817 ); 818 819 $data[] = array( 820 $post_key, 821 $user, 822 '/?feed=rss&p=%ID%', 823 '/?feed=rss&p=%ID%', 824 true, 825 ); 826 827 $data[] = array( 828 $post_key, 829 $user, 830 '/?feed=rss&p=%ID%', 831 '/?feed=rss&p=%ID%', 832 false, 545 833 ); 546 834 } … … 560 848 * @param string $requested Requested URL. 561 849 * @param string $expected Expected URL. 850 * @param string $enable_attachment_pages Whether to enable attachment pages. Default true. 562 851 */ 563 public function test_canonical_redirects_to_pretty_permalinks( $post_key, $user_role, $requested, $expected ) { 852 public function test_canonical_redirects_to_pretty_permalinks( $post_key, $user_role, $requested, $expected, $enable_attachment_pages = true ) { 853 if ( $enable_attachment_pages ) { 854 update_option( 'wp_attachment_pages_enabled', 1 ); 855 } else { 856 update_option( 'wp_attachment_pages_enabled', 0 ); 857 } 858 564 859 wp_set_current_user( self::$users[ $user_role ] ); 565 860 $this->set_permalink_structure( '/%postname%/' ); … … 606 901 '/?p=%ID%', 607 902 "/$post_key-post/", 903 true, 904 ); 905 906 $data[] = array( 907 $post_key, 908 $user, 909 '/?p=%ID%', 910 "/$post_key-post/", 911 false, 608 912 ); 609 913 … … 613 917 '/?attachment_id=%ID%', 614 918 "/$post_key-post/$post_key-inherited-attachment/", 919 true, 920 ); 921 922 $data[] = array( 923 "$post_key-attachment", 924 $user, 925 '/?attachment_id=%ID%', 926 '/?attachment_id=%ID%', 927 false, 615 928 ); 616 929 … … 620 933 '/?post_type=page&p=%ID%', 621 934 "/$post_key-page/", 935 true, 936 ); 937 938 $data[] = array( 939 "$post_key-page", 940 $user, 941 '/?post_type=page&p=%ID%', 942 "/$post_key-page/", 943 false, 622 944 ); 623 945 … … 627 949 '/?page_id=%ID%', 628 950 "/$post_key-page/", 951 true, 952 ); 953 954 $data[] = array( 955 "$post_key-page", 956 $user, 957 '/?page_id=%ID%', 958 "/$post_key-page/", 959 false, 629 960 ); 630 961 … … 634 965 "/?name=$post_key-post", 635 966 "/$post_key-post/", 967 true, 968 ); 969 970 $data[] = array( 971 $post_key, 972 $user, 973 "/?name=$post_key-post", 974 "/$post_key-post/", 975 false, 636 976 ); 637 977 … … 641 981 '/?feed=rss&p=%ID%', 642 982 "/$post_key-post/feed/", 983 true, 984 ); 985 986 $data[] = array( 987 $post_key, 988 $user, 989 '/?feed=rss&p=%ID%', 990 "/$post_key-post/feed/", 991 false, 643 992 ); 644 993 … … 648 997 '/?feed=rss&page_id=%ID%', 649 998 "/$post_key-page/feed/", 999 true, 1000 ); 1001 1002 $data[] = array( 1003 "$post_key-page", 1004 $user, 1005 '/?feed=rss&page_id=%ID%', 1006 "/$post_key-page/feed/", 1007 false, 650 1008 ); 651 1009 } … … 659 1017 '/?p=%ID%', 660 1018 "/$post_key-post/", 1019 true, 1020 ); 1021 1022 $data[] = array( 1023 $post_key, 1024 $user, 1025 '/?p=%ID%', 1026 "/$post_key-post/", 1027 false, 661 1028 ); 662 1029 … … 666 1033 '/?attachment_id=%ID%', 667 1034 "/$post_key-post/$post_key-inherited-attachment/", 1035 true, 1036 ); 1037 1038 $data[] = array( 1039 "$post_key-attachment", 1040 $user, 1041 '/?attachment_id=%ID%', 1042 '/?attachment_id=%ID%', 1043 false, 668 1044 ); 669 1045 … … 673 1049 '/?post_type=page&p=%ID%', 674 1050 "/$post_key-page/", 1051 true, 1052 ); 1053 1054 $data[] = array( 1055 "$post_key-page", 1056 $user, 1057 '/?post_type=page&p=%ID%', 1058 "/$post_key-page/", 1059 false, 675 1060 ); 676 1061 … … 680 1065 '/?page_id=%ID%', 681 1066 "/$post_key-page/", 1067 true, 1068 ); 1069 1070 $data[] = array( 1071 "$post_key-page", 1072 $user, 1073 '/?page_id=%ID%', 1074 "/$post_key-page/", 1075 false, 682 1076 ); 683 1077 … … 687 1081 "/?name=$post_key-post", 688 1082 "/$post_key-post/", 1083 true, 1084 ); 1085 1086 $data[] = array( 1087 $post_key, 1088 $user, 1089 "/?name=$post_key-post", 1090 "/$post_key-post/", 1091 false, 689 1092 ); 690 1093 … … 694 1097 '/?feed=rss&p=%ID%', 695 1098 "/$post_key-post/feed/", 1099 true, 1100 ); 1101 1102 $data[] = array( 1103 $post_key, 1104 $user, 1105 '/?feed=rss&p=%ID%', 1106 "/$post_key-post/feed/", 1107 false, 696 1108 ); 697 1109 … … 701 1113 '/?feed=rss&page_id=%ID%', 702 1114 "/$post_key-page/feed/", 1115 true, 1116 ); 1117 1118 $data[] = array( 1119 "$post_key-page", 1120 $user, 1121 '/?feed=rss&page_id=%ID%', 1122 "/$post_key-page/feed/", 1123 false, 703 1124 ); 704 1125 } … … 710 1131 '/?p=%ID%', 711 1132 '/?p=%ID%', 712 ); 713 714 $data[] = array( 715 "$post_key-attachment", 716 $user, 717 '/?attachment_id=%ID%', 718 '/?attachment_id=%ID%', 719 ); 720 721 $data[] = array( 722 "$post_key-page", 723 $user, 724 '/?post_type=page&p=%ID%', 725 '/?post_type=page&p=%ID%', 1133 true, 1134 ); 1135 1136 $data[] = array( 1137 $post_key, 1138 $user, 1139 '/?p=%ID%', 1140 '/?p=%ID%', 1141 false, 1142 ); 1143 1144 $data[] = array( 1145 "$post_key-attachment", 1146 $user, 1147 '/?attachment_id=%ID%', 1148 '/?attachment_id=%ID%', 1149 true, 1150 ); 1151 1152 $data[] = array( 1153 "$post_key-attachment", 1154 $user, 1155 '/?attachment_id=%ID%', 1156 '/?attachment_id=%ID%', 1157 false, 1158 ); 1159 1160 $data[] = array( 1161 "$post_key-page", 1162 $user, 1163 '/?post_type=page&p=%ID%', 1164 '/?post_type=page&p=%ID%', 1165 true, 1166 ); 1167 1168 $data[] = array( 1169 "$post_key-page", 1170 $user, 1171 '/?post_type=page&p=%ID%', 1172 '/?post_type=page&p=%ID%', 1173 false, 726 1174 ); 727 1175 … … 731 1179 '/?page_id=%ID%', 732 1180 '/?page_id=%ID%', 733 ); 734 735 $data[] = array( 736 $post_key, 737 $user, 738 "/?name=$post_key-post", 739 "/?name=$post_key-post", 740 ); 741 742 $data[] = array( 743 $post_key, 744 $user, 745 '/?feed=rss&p=%ID%', 746 '/?feed=rss&p=%ID%', 747 ); 748 749 $data[] = array( 750 "$post_key-page", 751 $user, 752 '/?feed=rss&page_id=%ID%', 753 '/?feed=rss&page_id=%ID%', 1181 true, 1182 ); 1183 1184 $data[] = array( 1185 "$post_key-page", 1186 $user, 1187 '/?page_id=%ID%', 1188 '/?page_id=%ID%', 1189 false, 1190 ); 1191 1192 $data[] = array( 1193 $post_key, 1194 $user, 1195 "/?name=$post_key-post", 1196 "/?name=$post_key-post", 1197 true, 1198 ); 1199 1200 $data[] = array( 1201 $post_key, 1202 $user, 1203 "/?name=$post_key-post", 1204 "/?name=$post_key-post", 1205 false, 1206 ); 1207 1208 $data[] = array( 1209 $post_key, 1210 $user, 1211 '/?feed=rss&p=%ID%', 1212 '/?feed=rss&p=%ID%', 1213 true, 1214 ); 1215 1216 $data[] = array( 1217 $post_key, 1218 $user, 1219 '/?feed=rss&p=%ID%', 1220 '/?feed=rss&p=%ID%', 1221 false, 1222 ); 1223 1224 $data[] = array( 1225 "$post_key-page", 1226 $user, 1227 '/?feed=rss&page_id=%ID%', 1228 '/?feed=rss&page_id=%ID%', 1229 true, 1230 ); 1231 1232 $data[] = array( 1233 "$post_key-page", 1234 $user, 1235 '/?feed=rss&page_id=%ID%', 1236 '/?feed=rss&page_id=%ID%', 1237 false, 754 1238 ); 755 1239 } … … 763 1247 '/?p=%ID%', 764 1248 "/$post_key/$post_key/", 1249 true, 1250 ); 1251 1252 $data[] = array( 1253 $post_key, 1254 $user, 1255 '/?p=%ID%', 1256 "/$post_key/$post_key/", 1257 false, 765 1258 ); 766 1259 … … 770 1263 '/?attachment_id=%ID%', 771 1264 "/$post_key/$post_key/$post_key-inherited-attachment/", 1265 true, 1266 ); 1267 1268 $data[] = array( 1269 "$post_key-attachment", 1270 $user, 1271 '/?attachment_id=%ID%', 1272 '/?attachment_id=%ID%', 1273 false, 772 1274 ); 773 1275 … … 777 1279 "/?name=$post_key&post_type=$post_key", 778 1280 "/$post_key/$post_key/?post_type=$post_key", 1281 true, 1282 ); 1283 1284 $data[] = array( 1285 $post_key, 1286 $user, 1287 "/?name=$post_key&post_type=$post_key", 1288 "/$post_key/$post_key/?post_type=$post_key", 1289 false, 779 1290 ); 780 1291 … … 784 1295 '/?feed=rss&p=%ID%', 785 1296 "/$post_key/$post_key/feed/", 1297 true, 1298 ); 1299 1300 $data[] = array( 1301 $post_key, 1302 $user, 1303 '/?feed=rss&p=%ID%', 1304 "/$post_key/$post_key/feed/", 1305 false, 786 1306 ); 787 1307 } … … 793 1313 '/?p=%ID%', 794 1314 '/?p=%ID%', 795 ); 796 797 $data[] = array( 798 "$post_key-attachment", 799 $user, 800 '/?attachment_id=%ID%', 801 '/?attachment_id=%ID%', 802 ); 803 804 $data[] = array( 805 $post_key, 806 $user, 807 "/?name=$post_key&post_type=$post_key", 808 "/?name=$post_key&post_type=$post_key", 809 ); 810 811 $data[] = array( 812 $post_key, 813 $user, 814 '/?feed=rss&p=%ID%', 815 '/?feed=rss&p=%ID%', 1315 true, 1316 ); 1317 1318 $data[] = array( 1319 $post_key, 1320 $user, 1321 '/?p=%ID%', 1322 '/?p=%ID%', 1323 false, 1324 ); 1325 1326 $data[] = array( 1327 "$post_key-attachment", 1328 $user, 1329 '/?attachment_id=%ID%', 1330 '/?attachment_id=%ID%', 1331 true, 1332 ); 1333 1334 $data[] = array( 1335 "$post_key-attachment", 1336 $user, 1337 '/?attachment_id=%ID%', 1338 '/?attachment_id=%ID%', 1339 false, 1340 ); 1341 1342 $data[] = array( 1343 $post_key, 1344 $user, 1345 "/?name=$post_key&post_type=$post_key", 1346 "/?name=$post_key&post_type=$post_key", 1347 true, 1348 ); 1349 1350 $data[] = array( 1351 $post_key, 1352 $user, 1353 "/?name=$post_key&post_type=$post_key", 1354 "/?name=$post_key&post_type=$post_key", 1355 false, 1356 ); 1357 1358 $data[] = array( 1359 $post_key, 1360 $user, 1361 '/?feed=rss&p=%ID%', 1362 '/?feed=rss&p=%ID%', 1363 true, 1364 ); 1365 1366 $data[] = array( 1367 $post_key, 1368 $user, 1369 '/?feed=rss&p=%ID%', 1370 '/?feed=rss&p=%ID%', 1371 false, 816 1372 ); 817 1373 } … … 825 1381 '/?p=%ID%', 826 1382 '/?p=%ID%', 827 ); 828 829 $data[] = array( 830 "$post_key-attachment", 831 $user, 832 '/?attachment_id=%ID%', 833 '/?attachment_id=%ID%', 834 // "/$post_key-inherited-attachment/", 835 ); 836 837 $data[] = array( 838 $post_key, 839 $user, 840 "/?name=$post_key&post_type=$post_key", 841 "/?name=$post_key&post_type=$post_key", 842 ); 843 844 $data[] = array( 845 $post_key, 846 $user, 847 '/?feed=rss&p=%ID%', 848 '/?feed=rss&p=%ID%', 1383 true, 1384 ); 1385 1386 $data[] = array( 1387 $post_key, 1388 $user, 1389 '/?p=%ID%', 1390 '/?p=%ID%', 1391 false, 1392 ); 1393 1394 $data[] = array( 1395 "$post_key-attachment", 1396 $user, 1397 '/?attachment_id=%ID%', 1398 '/?attachment_id=%ID%', 1399 true, 1400 ); 1401 1402 $data[] = array( 1403 "$post_key-attachment", 1404 $user, 1405 '/?attachment_id=%ID%', 1406 '/?attachment_id=%ID%', 1407 false, 1408 ); 1409 1410 $data[] = array( 1411 $post_key, 1412 $user, 1413 "/?name=$post_key&post_type=$post_key", 1414 "/?name=$post_key&post_type=$post_key", 1415 true, 1416 ); 1417 1418 $data[] = array( 1419 $post_key, 1420 $user, 1421 "/?name=$post_key&post_type=$post_key", 1422 "/?name=$post_key&post_type=$post_key", 1423 false, 1424 ); 1425 1426 $data[] = array( 1427 $post_key, 1428 $user, 1429 '/?feed=rss&p=%ID%', 1430 '/?feed=rss&p=%ID%', 1431 true, 1432 ); 1433 1434 $data[] = array( 1435 $post_key, 1436 $user, 1437 '/?feed=rss&p=%ID%', 1438 '/?feed=rss&p=%ID%', 1439 false, 849 1440 ); 850 1441 } … … 858 1449 '/?p=%ID%', 859 1450 '/?p=%ID%', 860 ); 861 862 $data[] = array( 863 "$post_key-attachment", 864 $user, 865 '/?attachment_id=%ID%', 866 '/?attachment_id=%ID%', 867 ); 868 869 $data[] = array( 870 "$post_key-page", 871 $user, 872 '/?post_type=page&p=%ID%', 873 '/?post_type=page&p=%ID%', 1451 true, 1452 ); 1453 1454 $data[] = array( 1455 $post_key, 1456 $user, 1457 '/?p=%ID%', 1458 '/?p=%ID%', 1459 false, 1460 ); 1461 1462 $data[] = array( 1463 "$post_key-attachment", 1464 $user, 1465 '/?attachment_id=%ID%', 1466 '/?attachment_id=%ID%', 1467 true, 1468 ); 1469 1470 $data[] = array( 1471 "$post_key-attachment", 1472 $user, 1473 '/?attachment_id=%ID%', 1474 '/?attachment_id=%ID%', 1475 false, 1476 ); 1477 1478 $data[] = array( 1479 "$post_key-page", 1480 $user, 1481 '/?post_type=page&p=%ID%', 1482 '/?post_type=page&p=%ID%', 1483 true, 1484 ); 1485 1486 $data[] = array( 1487 "$post_key-page", 1488 $user, 1489 '/?post_type=page&p=%ID%', 1490 '/?post_type=page&p=%ID%', 1491 false, 874 1492 ); 875 1493 … … 879 1497 '/?page_id=%ID%', 880 1498 '/?page_id=%ID%', 881 ); 882 883 $data[] = array( 884 $post_key, 885 $user, 886 "/?name=$post_key-post", 887 "/?name=$post_key-post", 888 ); 889 890 $data[] = array( 891 $post_key, 892 $user, 893 '/?feed=rss&p=%ID%', 894 '/?feed=rss&p=%ID%', 895 ); 896 897 $data[] = array( 898 "$post_key-page", 899 $user, 900 '/?feed=rss&page_id=%ID%', 901 '/?feed=rss&page_id=%ID%', 1499 true, 1500 ); 1501 1502 $data[] = array( 1503 "$post_key-page", 1504 $user, 1505 '/?page_id=%ID%', 1506 '/?page_id=%ID%', 1507 false, 1508 ); 1509 1510 $data[] = array( 1511 $post_key, 1512 $user, 1513 "/?name=$post_key-post", 1514 "/?name=$post_key-post", 1515 true, 1516 ); 1517 1518 $data[] = array( 1519 $post_key, 1520 $user, 1521 "/?name=$post_key-post", 1522 "/?name=$post_key-post", 1523 false, 1524 ); 1525 1526 $data[] = array( 1527 $post_key, 1528 $user, 1529 '/?feed=rss&p=%ID%', 1530 '/?feed=rss&p=%ID%', 1531 true, 1532 ); 1533 1534 $data[] = array( 1535 $post_key, 1536 $user, 1537 '/?feed=rss&p=%ID%', 1538 '/?feed=rss&p=%ID%', 1539 false, 1540 ); 1541 1542 $data[] = array( 1543 "$post_key-page", 1544 $user, 1545 '/?feed=rss&page_id=%ID%', 1546 '/?feed=rss&page_id=%ID%', 1547 true, 1548 ); 1549 1550 $data[] = array( 1551 "$post_key-page", 1552 $user, 1553 '/?feed=rss&page_id=%ID%', 1554 '/?feed=rss&page_id=%ID%', 1555 false, 902 1556 ); 903 1557 } … … 911 1565 '/?p=%ID%', 912 1566 '/?p=%ID%', 913 ); 914 915 $data[] = array( 916 "$post_key-attachment", 917 $user, 918 '/?attachment_id=%ID%', 919 '/?attachment_id=%ID%', 1567 true, 1568 ); 1569 1570 $data[] = array( 1571 $post_key, 1572 $user, 1573 '/?p=%ID%', 1574 '/?p=%ID%', 1575 false, 1576 ); 1577 1578 $data[] = array( 1579 "$post_key-attachment", 1580 $user, 1581 '/?attachment_id=%ID%', 1582 '/?attachment_id=%ID%', 1583 true, 1584 ); 1585 1586 $data[] = array( 1587 "$post_key-attachment", 1588 $user, 1589 '/?attachment_id=%ID%', 1590 '/?attachment_id=%ID%', 1591 false, 920 1592 ); 921 1593 … … 925 1597 '/trash-post/trash-post-inherited-attachment/', 926 1598 '/?attachment_id=%ID%', 1599 true, 1600 ); 1601 1602 $data[] = array( 1603 "$post_key-attachment", 1604 $user, 1605 '/trash-post/trash-post-inherited-attachment/', 1606 '/?attachment_id=%ID%', 1607 false, 927 1608 ); 928 1609 … … 932 1613 '/trash-post__trashed/trash-post-inherited-attachment/', 933 1614 '/?attachment_id=%ID%', 934 ); 935 936 $data[] = array( 937 "$post_key-page", 938 $user, 939 '/?post_type=page&p=%ID%', 940 '/?post_type=page&p=%ID%', 1615 true, 1616 ); 1617 1618 $data[] = array( 1619 "$post_key-attachment", 1620 $user, 1621 '/trash-post__trashed/trash-post-inherited-attachment/', 1622 '/?attachment_id=%ID%', 1623 false, 1624 ); 1625 1626 $data[] = array( 1627 "$post_key-page", 1628 $user, 1629 '/?post_type=page&p=%ID%', 1630 '/?post_type=page&p=%ID%', 1631 true, 1632 ); 1633 1634 $data[] = array( 1635 "$post_key-page", 1636 $user, 1637 '/?post_type=page&p=%ID%', 1638 '/?post_type=page&p=%ID%', 1639 false, 941 1640 ); 942 1641 … … 946 1645 '/?page_id=%ID%', 947 1646 '/?page_id=%ID%', 948 ); 949 950 $data[] = array( 951 $post_key, 952 $user, 953 "/?name=$post_key-post", 954 "/?name=$post_key-post", 955 ); 956 957 $data[] = array( 958 $post_key, 959 $user, 960 '/?feed=rss&p=%ID%', 961 '/?feed=rss&p=%ID%', 962 ); 963 964 $data[] = array( 965 "$post_key-page", 966 $user, 967 '/?feed=rss&page_id=%ID%', 968 '/?feed=rss&page_id=%ID%', 1647 true, 1648 ); 1649 1650 $data[] = array( 1651 "$post_key-page", 1652 $user, 1653 '/?page_id=%ID%', 1654 '/?page_id=%ID%', 1655 false, 1656 ); 1657 1658 $data[] = array( 1659 $post_key, 1660 $user, 1661 "/?name=$post_key-post", 1662 "/?name=$post_key-post", 1663 true, 1664 ); 1665 1666 $data[] = array( 1667 $post_key, 1668 $user, 1669 "/?name=$post_key-post", 1670 "/?name=$post_key-post", 1671 false, 1672 ); 1673 1674 $data[] = array( 1675 $post_key, 1676 $user, 1677 '/?feed=rss&p=%ID%', 1678 '/?feed=rss&p=%ID%', 1679 true, 1680 ); 1681 1682 $data[] = array( 1683 $post_key, 1684 $user, 1685 '/?feed=rss&p=%ID%', 1686 '/?feed=rss&p=%ID%', 1687 false, 1688 ); 1689 1690 $data[] = array( 1691 "$post_key-page", 1692 $user, 1693 '/?feed=rss&page_id=%ID%', 1694 '/?feed=rss&page_id=%ID%', 1695 true, 1696 ); 1697 1698 $data[] = array( 1699 "$post_key-page", 1700 $user, 1701 '/?feed=rss&page_id=%ID%', 1702 '/?feed=rss&page_id=%ID%', 1703 false, 969 1704 ); 970 1705 }
Note: See TracChangeset
for help on using the changeset viewer.