291 | | $url = apply_filters('url_to_postid', $url); |
| 291 | /** |
| 292 | * Filter the URL prior to using it to find the post ID. |
| 293 | * |
| 294 | * This filter fires before the URL is used to find the post ID. |
| 295 | * If a hook returns a "default permalink" URL, the ID in the URL |
| 296 | * will be returned by the parent function. For instance, returning |
| 297 | * '/?p=12345' means that the function will return 12345. |
| 298 | * |
| 299 | * @since 2.2.0 |
| 300 | * |
| 301 | * @param string $url The URL which will be searched. |
| 302 | */ |
| 303 | $url = apply_filters( 'url_to_postid', $url ); |
1563 | | $post_rewrite = apply_filters('post_rewrite_rules', $post_rewrite); |
| 1575 | /** |
| 1576 | * Filters the "post" post type rewrite rules before they're added to the rewrite rules array. |
| 1577 | * |
| 1578 | * This array should include all rewrite rules that were generated for accessing the |
| 1579 | * "post" post types paths, archive paths, etc. This does not include date-based paths. |
| 1580 | * |
| 1581 | * @since 1.5.0 |
| 1582 | * |
| 1583 | * @param array $post_rewrite The rewrite rules for the "post" post type. |
| 1584 | */ |
| 1585 | $post_rewrite = apply_filters( 'post_rewrite_rules', $post_rewrite ); |
1566 | | $date_rewrite = $this->generate_rewrite_rules($this->get_date_permastruct(), EP_DATE); |
1567 | | $date_rewrite = apply_filters('date_rewrite_rules', $date_rewrite); |
| 1588 | $date_rewrite = $this->generate_rewrite_rules( $this->get_date_permastruct(), EP_DATE ); |
| 1589 | /** |
| 1590 | * Filters the date-based rewrite rules before they're added to the rewrite rules array. |
| 1591 | * |
| 1592 | * This array should include all rewrite rules that were generated for listing posts |
| 1593 | * by date, e.g. /yyyy/, /yyyy/mm/, and /yyyy/mm/dd/. |
| 1594 | * |
| 1595 | * @since 1.5.0 |
| 1596 | * |
| 1597 | * @param array $date_rewrite The rewrite rules for date archives. |
| 1598 | */ |
| 1599 | $date_rewrite = apply_filters( 'date_rewrite_rules', $date_rewrite ); |
1570 | | $root_rewrite = $this->generate_rewrite_rules($this->root . '/', EP_ROOT); |
1571 | | $root_rewrite = apply_filters('root_rewrite_rules', $root_rewrite); |
| 1602 | $root_rewrite = $this->generate_rewrite_rules( $this->root . '/', EP_ROOT ); |
| 1603 | /** |
| 1604 | * Filters the root-level rewrite rules before they're added to the rewrite rules array. |
| 1605 | * |
| 1606 | * The root-level rewrite rules include pagination rules for the homepage as well as |
| 1607 | * site-wide post feeds (e.g. /feed/ and /feed/atom/). |
| 1608 | * |
| 1609 | * @since 1.5.0 |
| 1610 | * |
| 1611 | * @param array $root_rewrite The root-level rewrite rules. |
| 1612 | */ |
| 1613 | $root_rewrite = apply_filters( 'root_rewrite_rules', $root_rewrite ); |
1574 | | $comments_rewrite = $this->generate_rewrite_rules($this->root . $this->comments_base, EP_COMMENTS, false, true, true, false); |
1575 | | $comments_rewrite = apply_filters('comments_rewrite_rules', $comments_rewrite); |
| 1616 | $comments_rewrite = $this->generate_rewrite_rules( $this->root . $this->comments_base, EP_COMMENTS, false, true, true, false ); |
| 1617 | /** |
| 1618 | * Filters the comments feed rewrite rules before they're added to the rewrite rules array. |
| 1619 | * |
| 1620 | * The comments rewrite rules include the paths for accessing the comments feeds, |
| 1621 | * for instance /comments/feed/ and /comments/feed/atom/. |
| 1622 | * |
| 1623 | * @since 1.5.0 |
| 1624 | * |
| 1625 | * @param array $comments_rewrite The rewrite rules for the site-wide comments feeds. |
| 1626 | */ |
| 1627 | $comments_rewrite = apply_filters( 'comments_rewrite_rules', $comments_rewrite ); |
1579 | | $search_rewrite = $this->generate_rewrite_rules($search_structure, EP_SEARCH); |
1580 | | $search_rewrite = apply_filters('search_rewrite_rules', $search_rewrite); |
| 1631 | $search_rewrite = $this->generate_rewrite_rules( $search_structure, EP_SEARCH ); |
| 1632 | /** |
| 1633 | * Filters the search rewrite rules before they're added to the rewrite rules array. |
| 1634 | * |
| 1635 | * The search-related rewrite rules include /search/some+search+query/ as well as |
| 1636 | * pagination and feed paths for a search. |
| 1637 | * |
| 1638 | * @since 1.5.0 |
| 1639 | * |
| 1640 | * @param array $search_rewrite The rewrite rules for search queries. |
| 1641 | */ |
| 1642 | $search_rewrite = apply_filters( 'search_rewrite_rules', $search_rewrite ); |
1583 | | $author_rewrite = $this->generate_rewrite_rules($this->get_author_permastruct(), EP_AUTHORS); |
1584 | | $author_rewrite = apply_filters('author_rewrite_rules', $author_rewrite); |
| 1645 | $author_rewrite = $this->generate_rewrite_rules( $this->get_author_permastruct(), EP_AUTHORS ); |
| 1646 | /** |
| 1647 | * Filters the author rewrite rules before they're added to the rewrite rules array. |
| 1648 | * |
| 1649 | * The author rewrite rules include /author/author-name/ as well as pagination and |
| 1650 | * feed paths for author archives. |
| 1651 | * |
| 1652 | * @since 1.5.0 |
| 1653 | * |
| 1654 | * @param array $author_rewrite The rewrite rules for author archives. |
| 1655 | */ |
| 1656 | $author_rewrite = apply_filters( 'author_rewrite_rules', $author_rewrite ); |
1601 | | $rules = apply_filters($permastructname . '_rewrite_rules', $rules); |
1602 | | if ( 'post_tag' == $permastructname ) |
1603 | | $rules = apply_filters('tag_rewrite_rules', $rules); |
| 1680 | /** |
| 1681 | * Filters the rewrite rules for individual extra permalink structures. |
| 1682 | * |
| 1683 | * Extra permalink structures are typically added via add_permastruct() (used |
| 1684 | * by both register_post_type and register_taxonomy). For instance, the |
| 1685 | * 'category' taxonomy adds the 'category' permastruct, and this will apply |
| 1686 | * the filter 'category_rewrite_rules' to the generated rewrite rules. |
| 1687 | * |
| 1688 | * @since 3.1.0 |
| 1689 | * |
| 1690 | * @param array $rules The rewrite rules generated for the current permastruct. |
| 1691 | */ |
| 1692 | $rules = apply_filters( $permastructname . '_rewrite_rules', $rules ); |
| 1693 | if ( 'post_tag' == $permastructname ) { |
| 1694 | /** |
| 1695 | * Filter the generated rewrite rules for tags. |
| 1696 | * |
| 1697 | * This filter exists for backwards compatibility. The permastruct for |
| 1698 | * tags is "post_tag", so the generated rules can also be filtered via |
| 1699 | * post_tag_rewrite_rules. |
| 1700 | * |
| 1701 | * @since 2.3.0 |
| 1702 | * |
| 1703 | * @param array $rules The rewrite rules generated for tags. |
| 1704 | */ |
| 1705 | $rules = apply_filters( 'tag_rewrite_rules', $rules ); |
| 1706 | } |
1610 | | $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules); |
| 1713 | $this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $page_rewrite, $post_rewrite, $this->extra_rules ); |
1612 | | $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules); |
| 1715 | $this->rules = array_merge( $this->extra_rules_top, $robots_rewrite, $deprecated_files, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules ); |