• 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

wordpress function breaks wp-admin

Laravel - Implicit route model binding with soft deleted data

Woocommerce redirect after add-to-cart error

PHP password_verify

Converting IPv6 to IPv4 address in PHP

PHP to search within txt file and echo the whole line

Display the WooCommerce product price inside a custom function

Problems getting instance of UploadedFile in Yii2

In PHP, which is faster: preg_split or explode?

PHP mail function is sending blank message body

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

How to use PHPCBF to fix one issue at a time?

Laravel 5.5 change unauthenticated login redirect url

dockerizing Laravel + vue

About Contact Privacy policy Terms and conditions