• 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

Split a string array into pieces

onKeyUp event calculation not working on the following rows from php generated forms except the first one

Additional price based on cart item count in WooCommerce

Insert a DIV after the 6th product only once in WooCommerce category archives

User pool client {id}does not exist

PHP: Print caught exception like Xdebug

PHP array slice from position + attempt to return fixed number of items

Show Custom Data in Woocommerce Order Details Admin Area

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

Two buttons one form

array_map triple dimensional array [duplicate]

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

disable two buttons after clicking another button

Insert And Retrieve Data in MySQL with $.post Noob Question

Merge key and value of array index [duplicate]

About Contact Privacy policy Terms and conditions