WordPress.org

Make WordPress Core

Ticket #52889: link-template.diff

File link-template.diff, 812 bytes (added by cneumann, 6 months ago)

Proposal to add filter to wp_force_plain_post_permalink

  • src/wp-includes/link-template.php

    diff --git src/wp-includes/link-template.php src/wp-includes/link-template.php
    index 7cd756c4dd..c7b2c01203 100644
    function permalink_anchor( $mode = 'id' ) { 
    101101 * @return bool Whether to use a plain permalink structure.
    102102 */
    103103function wp_force_plain_post_permalink( $post = null, $sample = null ) {
     104        /**
     105         * Filters whether to disable forced plain post permalinks.
     106         *
     107         * If disabled, wp_force_plain_post_permalink will always return false.
     108         *
     109         * @since 5.7.1
     110         *
     111         * @param bool $disabled Whether forced plain post parmalinks should be disabled.
     112         */
     113        if ( apply_filters( 'forced_plain_post_permalinks_disabled', false ) ) {
     114                return false;
     115        }
    104116        if (
    105117                null === $sample &&
    106118                is_object( $post ) &&