• 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

Override default Auth routes in Laravel 7

Cache clear probem in Larave

Edit product hook WooCommerce

Send POST data via raw JSON with Postman

Transpose csv file data [duplicate]

JQuery content editable div and text box on submit not sending POST

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

Minimum order amount except for specific shipping method in WooCommerce

Why does array_map() with null as callback create an "array of arrays"?

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

Check if a string contain multiple specific words

Results page in other window

Last order would be re-order in wooCommerce. How is it possible?

How Can I Do LIMIT 1, 2 In WP_Query

How to unlink image from folder?

About Contact Privacy policy Terms and conditions