• 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

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

Send Outlook 2010 email using PHP

Can I write PHP code across multiple lines per statement?

Add and update products to session cart in Laravel

PHP Slim Framework request using withAttribute error

enroll_table three field fetch to payment form to create payment field in laravel 5.5

How can I make this nested location configuration use the correct path to call a php program?

Distribute array row data to make multiple new rows

Cannot connect to own websocket server when on secured domain

Read users and passwords from a txt file

laravel automatically deletes server.php on php artisan serve

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

Hide specific products from unlogged users based in product category in WooCommerce

insert multiple rows in a saveall in cakephp

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

About Contact Privacy policy Terms and conditions