• 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

PHP - CURL using HTTPS [closed]

How can I get a div content in php

display WooCommerce “Add to cart” button with short-code [add_to_cart ] dynamically

Failing validation doesn't stop code execution in livewire component

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Require a class from another class - php

PHP - Store information with NO database

Adding custom body class to the custom archive pages

html-php form submission after validation through JavaScript [closed]

nginx err_connection_refused, can anyone help me?

Pass a select with mysqli_fetch_row to a table

Limit login attempts in Laravel 5.7

Having issue with matching rows in the database using PDO

How to Generate PDF invoice to XML format using mPDF

About Contact Privacy policy Terms and conditions