• 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 submit the custom form data in database in WordPress without plugin using ajax?

How to set dynamic `home` and `siteurl` in WordPress?

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

Implode array with array of glue strings

How can I get new CSRF token in LARAVEL by using ajax

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

Edit product hook WooCommerce

Redis Command To Sort Keys

Sort a multidimensional array by integer inside of a string value which is two levels down

Laravel post contact form giving me error 419

How Can I Do LIMIT 1, 2 In WP_Query

JSON Render Issue in Date Object Laravel and PHP 7.4

could not find driver Debian SQL Server PHP

Converting IPv6 to IPv4 address in PHP

Show only featured products in Woocommerce shop page

About Contact Privacy policy Terms and conditions