Changeset 2041692
- Timestamp:
- 02/28/2019 06:37:54 PM (5 years ago)
- Location:
- custom-archives
- Files:
-
- 9 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
custom-archives/trunk/README.md
r1882024 r2041692 16 16 - [Help with Translations](https://translate.wordpress.org/projects/wp-plugins/custom-archives) 17 17 - [GitHub Repository](https://github.com/danieltj27/Custom-Archives) 18 - [ Personal Blog](https://www.danieltj.co.uk/)18 - [.uk/) 19 19 -
custom-archives/trunk/custom-archives.php
r2018570 r2041692 8 8 * Author URI: https://danieltj.uk/ 9 9 * Text Domain: custom-archives 10 * Version: 1.410 * Version: 11 11 */ 12 12 … … 39 39 * The plugin version. 40 40 * 41 * @since 1.042 *43 41 * @var string 44 42 */ 45 protected static $version = ' 1.4';43 protected static $version = ''; 46 44 47 45 /** 48 46 * Puts the archive into WordPress. 49 *50 * @since 1.051 47 * 52 48 * @return void … … 66 62 add_filter( 'document_title_parts', array( __CLASS__, 'rewrite_page_title' ), 15, 1 ); 67 63 add_filter( 'template_include', array( __CLASS__, 'archive_template' ), 20, 1 ); 64 68 65 add_filter( 'get_sample_permalink_html', array( __CLASS__, 'rewrite_edit_permalink' ), 15, 5 ); 69 66 … … 73 70 * Load the plugin text domain. 74 71 * 75 * @since 1.076 *77 72 * @return void 78 73 */ … … 85 80 /** 86 81 * Gets all available post types. 87 *88 * @since 1.089 82 * 90 83 * @return array $post_types An array of post types. … … 114 107 * Filter the array of post types. 115 108 * 116 * @since 1.0117 *118 109 * @param array $post_types The array of post types. 119 110 * … … 129 120 * Get the custom archive page IDs. 130 121 * 131 * @since 1.0132 *133 122 * @return array $pages 134 123 */ … … 164 153 /** 165 154 * Filter the array of custom archives. 166 *167 * @since 1.0168 155 * 169 156 * @param array $pages The array of custom archive ids. … … 178 165 * Get the custom archive post type. 179 166 * 180 * @since 1.0181 *182 167 * @param int $page_id The page id to search. 183 168 * … … 209 194 * passed through the function. 210 195 * 211 * @since 1.0212 *213 196 * @param int $page_id The page id to search. 214 197 * … … 252 235 /** 253 236 * Add the plugin admin page. 254 *255 * @since 1.0256 237 * 257 238 * @return void … … 272 253 /** 273 254 * Print the admin plugin page HTML. 274 *275 * @since 1.0276 255 * 277 256 * @return string … … 312 291 * to the Reading settings page. 313 292 * 314 * @since 1.0315 * @since 1.3 Added ignore post loop setting.316 *317 293 * @return void 318 294 */ … … 379 355 * Print the checkbox setting UI. 380 356 * 381 * @since 1.3382 *383 357 * @param array $args The settings field arguments. 384 358 * … … 402 376 /** 403 377 * Print the select setting UI. 404 *405 * @since 1.3406 378 * 407 379 * @param array $args The settings field arguments. … … 434 406 * Verify the archive settings value. 435 407 * 436 * @since 1.0437 *438 408 * @param int $new_value The new settings value. 439 409 * … … 462 432 * Redirect to the archive page. 463 433 * 464 * When the custom archive page is requested, 465 * redirect to the real archive page so we can 466 * filter it properly. 467 * 468 * @since 1.0 469 * @since 1.3 Improve post check and added filter for status header. 434 * When the custom archive page is requested, redirect to 435 * the real archive page so we can filter it properly. 470 436 * 471 437 * @return void … … 531 497 * a custom archive page. 532 498 * 533 * @since 1.0534 *535 499 * @param string $new_status The new post status. 536 500 * @param string $old_status The old post status. … … 562 526 * if that page gets deleted from the site. 563 527 * 564 * @since 1.0565 *566 528 * @param int $post_id The deleted post id. 567 529 * … … 586 548 * Adds an edit page link to the toolbar when viewing 587 549 * an archive page that is using a custom archive. 588 *589 * @since 1.0590 * @since 1.2 Rewrote the logic for checking the archive page.591 550 * 592 551 * @param object $wp_admin_bar The toolbar links. … … 636 595 * Add post states to custom archives. 637 596 * 638 * @since 1.0639 *640 597 * @param array $states The collection of post states. 641 598 * @param object $post The current post object. … … 670 627 * Filter the custom archive page title. 671 628 * 672 * @since 1.0673 *674 629 * @param array $title An array of title parts. 675 630 * … … 708 663 709 664 /** 710 * Include the template for the selected 711 * page for this custom archive. 712 * 713 * Whilst it can be tricky in cases where a theme 714 * might not contain the default templates, this 715 * switches out the archive page template for the 716 * selected page template and gracefully degrades 717 * until a suitable one is found. 718 * 719 * @since 1.0 720 * @since 1.1 Better checks for templates and improvements to $wp_query. 721 * @since 1.3 Added support for ignoring the `have_posts` loop check. 665 * Include the template for the selected page 666 * for this custom archive. 667 * 668 * Whilst it can be tricky in cases where a theme might not contain 669 * the default templates, this switches out the archive page template 670 * for the selected page template and gracefully degrades until a 671 * suitable one is found. 722 672 * 723 673 * @param string $template The template name. … … 802 752 803 753 /** 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 804 803 * Rewrite the edit permalink HTML. 805 *806 * @since 1.0807 804 * 808 805 * @param string $return The HTML markup. … … 841 838 * Adds a donate link to the plugins table. 842 839 * 843 * @since 1.0844 *845 840 * @param array $links A list of plugin links 846 841 * @param string $file The current plugin file. -
custom-archives/trunk/readme.txt
r2018570 r2041692 1 1 === Custom Archives === 2 2 Contributors: danieltj 3 Tags: page, post types, archive, template, themes3 Tags: page, 4 4 Requires at least: 4.0 5 Tested up to: 5. 06 Stable tag: 1.45 Tested up to: 5. 6 Stable tag: 7 7 License: GNU GPL v3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 35 35 = Can I have a custom archive page for posts? = 36 36 37 By default WordPress allows you to use a special page as a custom archive page for posts so you don't need to use this plugin .37 By default WordPress allows you to use a special page as a custom archive page for posts so you don't need to use this plugin. 38 38 39 39 = Why am I not seeing any options? = 40 40 41 You must have at least one custom post type registered on your site for this plugin to have any effect. If you don't, you cannot use this.41 You . 42 42 43 43 = What happens if I delete the page? = 44 44 45 If you delete a page that is a custom archive page, it will automatically remove the setting and will safely default back to the standard archive page .45 If you delete a page that is a custom archive page, it will automatically remove the setting and will safely default back to the standard archive page. 46 46 47 = Can the archive use the page permalink instead? =47 = Can the archive use the page permalink? = 48 48 49 No, due to technical difficulties and user experience considerations ;the custom archive page must use the original archive permalink.49 No, due to technical difficulties and user experience considerations the custom archive page must use the original archive permalink. 50 50 51 51 = Can I use a page for multiple archives? = 52 52 53 No, this is not possible as the user is redirected to the original archive page and having multiple redirects would result in an error.53 No, this is not possible as the user is redirected to the original archive page . 54 54 55 55 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.