Making WordPress.org

Changeset 1320


Ignore:
Timestamp:
02/25/2015 08:42:14 AM (9 years ago)
Author:
dd32
Message:

Theme Directory: Generate the proper permalinks for the repopackage post_type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php

    r1318 r1320  
    116116
    117117/**
     118 * Filter the permalink for the Packages to be /post_name/
     119 *
     120 * @param string $link The generated permalink
     121 * @param string $post The package object
     122 * @return string
     123 */
     124function wporg_themes_package_link( $link, $post ) {
     125    if ( 'repopackage' != $post->post_type ) {
     126        return $link;
     127    }
     128
     129    return trailingslashit( home_url( $post->post_name ) );
     130}
     131add_filter( 'post_type_link', 'wporg_themes_package_link', 10, 2 );
     132
     133/**
    118134 * Adjusts the amount of found posts when browsing featured themes.
    119135 *
Note: See TracChangeset for help on using the changeset viewer.