• 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 disable only_full_group_by option in Laravel

Laravel Passport - Not able to get token string in response?

Encrypt in php and decrypt in Dart(flutter)

Merge column values from two arrays to form an indexed array of associative arrays

sort() not affecting original array while inside foreach loop

Convert PHP array into HTML tag attributes separated by spaces

WordPress Subquery returns more than 1 row on SELECT

Could not decode a text frame as UTF-8.

Doctrine 2 mapping referencing unique key

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

How can I make a full text index of the column?

How do I enable error reporting in Laravel?

HTML and PHP in one file

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

Get all WooCommerce products within own plugin

About Contact Privacy policy Terms and conditions