• 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 create a individual template for page or post in custom plugin?

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

Ajax GET request fails in laravel 8

Login if user is active using Laravel Breeze

Laravel eloquent update record without loading from database

How do I remove this delivery notification from here?

Don't show recurring price for WooCommerce subscriptions worth 0$

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

WordPress Subquery returns more than 1 row on SELECT

Statement that checks whether a URL contains a particular path?

Upload a file Using PHP and JavaScript

Show only featured products in Woocommerce shop page

Override default Auth routes in Laravel 7

Convert date and time to Jalali in Laravel

About Contact Privacy policy Terms and conditions