• 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 install LDAP in Docker php-fpm alpine

Target class controller does not exist - Laravel 8

PHP sort array of objects by two properties

How to run or debug php on Visual Studio Code (VSCode)

Select option from dropdown menu with PHP and mySql

Magento 2 - How to add new block to admin panel in product page?

php file upload scanning using clamav, permissions on /tmp/

php script to delete files older than 24 hrs, deletes all files

Exception thrown during the rendering of a template("Parameter "id" for route "url" must match "[^/]++" ("" given) to generate a corresponding URL.")

Target Laravelista is not instantiable

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

php retrieve specific data onclick from database in a list format

Detect if PHP session exists

Add record for each array elements if missing in table

Mysqli multi query error

About Contact Privacy policy Terms and conditions