• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Wordpress 'post_type_link' hides permalink

phpwordpresspermalinks


PHP Snippet 1:

function append_id_string( $link, $post ) {
    $post_meta = $post->ID;
    if ( 'product' == get_post_type( $post ) ) {
        $link = $link . '#' .$post_meta;
    } 
    return $link;
}

add_filter( 'post_type_link', 'append_id_string', 1, 2 );

Related Snippets

How to make dot match newline characters using regular expressions

Explode not working properly with dash

disable two buttons after clicking another button

Laravel 5.5 change unauthenticated login redirect url

protect my blog content

Laravel lang slug in url

selected value from the listbox in php

How to properly start Laravel 8 with Bootstrap & authentication

ConstraintViolationListInterface to Exception in Symfony

PHP if in_array() how to get the key as well?

Add restriction to WooCommerce coupons by allowed user ID

WordPress Subquery returns more than 1 row on SELECT

how to retrieve the first and last instance of a row in pdo dataset

How to edit Records using CodeIgniter

Adding hreflang tags automatically in WordPress subdirectory multisite

About Contact Privacy policy Terms and conditions