• 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 validate form data in codeigniter 4

Custom add to cart button URL for specific product in WooCommerce?

Converting array to string and then back in PHP

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

How to show a popup modal in codeIgniter?

xdebug 3 not working in ubuntu 20.04 with docker

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

codeigniter 4 running error first time with xampp

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Laravel 5 controller sending JSON integer as string

PHP how to detect if running on arm64 cpu?

Display Link Title Instead of URL in XSL

Object of class stdClass could not be converted to string error

How do I truncate a decimal in PHP?

About Contact Privacy policy Terms and conditions