• 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

Adding the custom page with add_menu_page function on Wordpress

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

How to make a foreign key not using primary key

MySQL default time format UTC or GMT?

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

How do I enable error reporting in Laravel?

Confirm Leave on External Links in Wordpress

Laravel - How to properly generate unique slugs from article titles?

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

how to hide previous markers when new markers added in google map javascript api

"cannot list resources" error from WooCommerce REST API

Why does using salted hash on python and php give me different results?

Store / Website Column in Magento 2 Admin Grid - Custom Module

MySQL upgrade causing unexpected results on simple WHERE clauses

Generate random username based on full name php

About Contact Privacy policy Terms and conditions