Plugin Directory

Changeset 2041692

Timestamp:
02/28/2019 06:37:54 PM (5 years ago)
Author:
danieltj
Message:

Update Custom Archives to v2.0

Location:
custom-archives
Files:
9 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • custom-archives/trunk/README.md

    r1882024 r2041692  
    1616- [Help with Translations](https://translate.wordpress.org/projects/wp-plugins/custom-archives)
    1717- [GitHub Repository](https://github.com/danieltj27/Custom-Archives)
    18 - [Personal Blog](https://www.danieltj.co.uk/)
     18- [.uk/)
    1919
  • custom-archives/trunk/custom-archives.php

    r2018570 r2041692  
    88 * Author URI: https://danieltj.uk/
    99 * Text Domain: custom-archives
    10  * Version: 1.4
     10 * Version:
    1111 */
    1212
     
    3939     * The plugin version.
    4040     *
    41      * @since 1.0
    42      *
    4341     * @var string
    4442     */
    45     protected static $version = '1.4';
     43    protected static $version = '';
    4644
    4745    /**
    4846     * Puts the archive into WordPress.
    49      *
    50      * @since 1.0
    5147     *
    5248     * @return void
     
    6662        add_filter( 'document_title_parts', array( __CLASS__, 'rewrite_page_title' ), 15, 1 );
    6763        add_filter( 'template_include', array( __CLASS__, 'archive_template' ), 20, 1 );
     64
    6865        add_filter( 'get_sample_permalink_html', array( __CLASS__, 'rewrite_edit_permalink' ), 15, 5 );
    6966
     
    7370     * Load the plugin text domain.
    7471     *
    75      * @since 1.0
    76      *
    7772     * @return void
    7873     */
     
    8580    /**
    8681     * Gets all available post types.
    87      *
    88      * @since 1.0
    8982     *
    9083     * @return array $post_types An array of post types.
     
    114107         * Filter the array of post types.
    115108         *
    116          * @since 1.0
    117          *
    118109         * @param array $post_types The array of post types.
    119110         *
     
    129120     * Get the custom archive page IDs.
    130121     *
    131      * @since 1.0
    132      *
    133122     * @return array $pages
    134123     */
     
    164153        /**
    165154         * Filter the array of custom archives.
    166          *
    167          * @since 1.0
    168155         *
    169156         * @param array $pages The array of custom archive ids.
     
    178165     * Get the custom archive post type.
    179166     *
    180      * @since 1.0
    181      *
    182167     * @param int $page_id The page id to search.
    183168     *
     
    209194     * passed through the function.
    210195     *
    211      * @since 1.0
    212      *
    213196     * @param int $page_id The page id to search.
    214197     *
     
    252235    /**
    253236     * Add the plugin admin page.
    254      *
    255      * @since 1.0
    256237     *
    257238     * @return void
     
    272253    /**
    273254     * Print the admin plugin page HTML.
    274      *
    275      * @since 1.0
    276255     *
    277256     * @return string
     
    312291     * to the Reading settings page.
    313292     *
    314      * @since 1.0
    315      * @since 1.3 Added ignore post loop setting.
    316      *
    317293     * @return void
    318294     */
     
    379355     * Print the checkbox setting UI.
    380356     *
    381      * @since 1.3
    382      *
    383357     * @param array $args The settings field arguments.
    384358     *
     
    402376    /**
    403377     * Print the select setting UI.
    404      *
    405      * @since 1.3
    406378     *
    407379     * @param array $args The settings field arguments.
     
    434406     * Verify the archive settings value.
    435407     *
    436      * @since 1.0
    437      *
    438408     * @param int $new_value The new settings value.
    439409     *
     
    462432     * Redirect to the archive page.
    463433     *
    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.
    470436     *
    471437     * @return void
     
    531497     * a custom archive page.
    532498     *
    533      * @since 1.0
    534      *
    535499     * @param string $new_status The new post status.
    536500     * @param string $old_status The old post status.
     
    562526     * if that page gets deleted from the site.
    563527     *
    564      * @since 1.0
    565      *
    566528     * @param int $post_id The deleted post id.
    567529     *
     
    586548     * Adds an edit page link to the toolbar when viewing
    587549     * an archive page that is using a custom archive.
    588      *
    589      * @since 1.0
    590      * @since 1.2 Rewrote the logic for checking the archive page.
    591550     *
    592551     * @param object $wp_admin_bar The toolbar links.
     
    636595     * Add post states to custom archives.
    637596     *
    638      * @since 1.0
    639      *
    640597     * @param array  $states The collection of post states.
    641598     * @param object $post   The current post object.
     
    670627     * Filter the custom archive page title.
    671628     *
    672      * @since 1.0
    673      *
    674629     * @param array $title An array of title parts.
    675630     *
     
    708663
    709664    /**
    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.
    722672     *
    723673     * @param string $template The template name.
     
    802752
    803753    /**
     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
    804803     * Rewrite the edit permalink HTML.
    805      *
    806      * @since 1.0
    807804     *
    808805     * @param string $return    The HTML markup.
     
    841838     * Adds a donate link to the plugins table.
    842839     *
    843      * @since 1.0
    844      *
    845840     * @param array  $links A list of plugin links
    846841     * @param string $file  The current plugin file.
  • custom-archives/trunk/readme.txt

    r2018570 r2041692  
    11=== Custom Archives ===
    22Contributors: danieltj
    3 Tags: page, post types, archive, template, themes
     3Tags: page,
    44Requires at least: 4.0
    5 Tested up to: 5.0
    6 Stable tag: 1.4
     5Tested up to: 5.
     6Stable tag:
    77License: GNU GPL v3
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3535= Can I have a custom archive page for posts? =
    3636
    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.
     37By 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.
    3838
    3939= Why am I not seeing any options? =
    4040
    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.
     41You .
    4242
    4343= What happens if I delete the page? =
    4444
    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.
     45If 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.
    4646
    47 = Can the archive use the page permalink instead? =
     47= Can the archive use the page permalink? =
    4848
    49 No, due to technical difficulties and user experience considerations; the custom archive page must use the original archive permalink.
     49No, due to technical difficulties and user experience considerations the custom archive page must use the original archive permalink.
    5050
    5151= Can I use a page for multiple archives? =
    5252
    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.
     53No, this is not possible as the user is redirected to the original archive page .
    5454
    5555== Screenshots ==
Note: See TracChangeset for help on using the changeset viewer.