• 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 insert data into select2 search input after scan using qrcode

Filter WooCommerce related products by Polylang language

WooCommerce: Add/display Product or Variation custom field everywhere

Warning: sqlite_query() expects parameter 1 to be resource, string given

PHP Deprecated issue when running artisan command

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

Xdebug in Laravel is not working with VSCode

Inserting Country Selection into MySQL PHP [duplicate]

PHP 8.1: strftime() is deprecated

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

No definition found for function in vendor vscode

Make certain characters of a word from string bold

html-php form submission after validation through JavaScript [closed]

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

How to read laravel_session cookies saved in cookie memory of browser in client side?

About Contact Privacy policy Terms and conditions