• 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 edit Records using CodeIgniter

Upgrade PHP on AWS Linux

Applying programmatically a coupon to an Order in WooCommerce3

How to redirect to another page after n seconds in wordpress without using javascript?

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

Increase value by 1 on button click

Nginx RTMP not recording

Substitute integers and dots with regex [duplicate]

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

Boolean assignment operators in PHP

Redis Command To Sort Keys

Laravel s3 upload file with metadata using pre-signed url

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

Laravel whole batch is cancelled if one Job fails

About Contact Privacy policy Terms and conditions