• 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 custom text under order details on WooCommerce My account view order pages

php echo xml documents with header

Laravel Collections. Is there some kind of assertStructure method?

How to override header set in Apache config with more specific header in a virtual host

How to change 'users' auth table and use another instead Laravel

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

file_get_contents() without "Http" to access external URL [closed]

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

shell errors running php exec

How to modify CSS in a specific page of the WP admin dashboard (backend)

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

WordPress Subquery returns more than 1 row on SELECT

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

VichUploaderBundle error "Expected argument of type "File", "NULL" given" when submitting the form without selecting any file

Symfony Mercure "Failed to send an update"

About Contact Privacy policy Terms and conditions