• 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 implement placeholder in a php file for moodle plugin?

Reading input in php from terminal

How to Generate PDF invoice to XML format using mPDF

browsersync doesn't work with XAMPP

How do I call a php file with axios?

Mobile browsers are adding .html to filename on download

How to disable widget block editor of WordPress?

how to use extended ASCII instead of unicode in PHP

How to get transaction details in notify_url page in paypal

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Laravel phpunit test failing authorization

Display the WooCommerce product price inside a custom function

Xdebug can't connect back to Docker host

woocommerce get_order_report_data to show order_item_id

Check If array is null or not in php

About Contact Privacy policy Terms and conditions