• 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

Add New Parameter to Existing URL using htaccess

Laravel MSSQL Server Connection not working

How to redirect to another page and call a Function there on Angular ng-click

Extract house numbers from address string

WordPress ACFNotice: get_field() - We've detected one or more calls to retrieve ACF field values before ACF has been initialized

Timber: Single post pagination does not work (wp_link_pages)

Get data from accuweather api url

"cannot list resources" error from WooCommerce REST API

WordPress - Dynamically add user ID to the end of a URL

Explode not working properly with dash

Warning: A non-numeric value encountered

Shortcode or PHP inside a shortcode in Wordpress

Add a custom text for a particular product on specific email notification in Woocommerce

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

Eloquent insert id with sequence next value

About Contact Privacy policy Terms and conditions