Automattic / Automattic/jetpack

Jetpack breaks wp_get_shortlink() instead of removing 'wp_shortlink_wp_head' hook!

Open
#8,250 7 comments 0 reactions 0 assignees View on GitHub
[Feature] Shortlinks [Pri] Normal [Status] Stale Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Jetpack has decided to return an empty string by default when `wp_get_shortlink()` is called for a custom post type. This disables the "shortlink" meta tag and "Get Shortlink" button, but ALSO breaks the WP core `wp_get_shortlink()` function! Jetpack is not the only plugin out there -- `wp_get_shortlink()` is used by other plugins for a variety of reasons -- standard core functionality should not be broken on purpose. Instead of break the `wp_get_shortlink()` function, please use this instead:

```
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
```

Thanks,

js.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Jetpack's handling of wp_get_shortlink() for custom post types and compare it with the issue's suggested wp_shortlink_wp_head action removal. Confirm that wp_get_shortlink() remains usable by other plugins while the shortlink meta tag and Get Shortlink button are disabled; the issue names no file or test to begin with.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.