• 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

Doctrine 2 mapping referencing unique key

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

How do I Post to .txt document before form submits

PHP date() with timezone?

How to add a custom field to all Woocommerce attribute terms using add_action

How to submit the custom form data in database in WordPress without plugin using ajax?

How to install LDAP in Docker php-fpm alpine

Wordpress wpdb->delete issue

Wordpress how to get the post thumbnail inside a figure tag

Laravel: HTML in notification

Laravel Multi-language routes without prefix

Can't exclude directories from .htaccess mobile redirect?

How to get the ID of the link in another page in php

Multiply each value in array using array_map function

Filter WooCommerce related products by Polylang language

About Contact Privacy policy Terms and conditions