• 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

Sliders in Laravel

How to install PHP composer inside a docker container

Target Individual Form Instance/Counter Inside A PHP While Loop

Wordpress wpdb->delete issue

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

PHPUnit 7: Failed asserting that exception of type InvalidArgumentException is thrown

WooCommerce: Add/display Product or Variation custom field everywhere

Remove product downloads section in woocommerce email notifications

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

(Cache::lock()) -> get() -- Under what conditions does it return false?

Alert message after submitting form in PHP

Chunk and transpose a flat array into rows with a specific number of columns

How to to send mail using gmail in Laravel?

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

Group rows by column and sum another column within groups [duplicate]

About Contact Privacy policy Terms and conditions