Digital Sovereignty for everyone

Hooks and filters

Filters

  • lh_page_links_to_get_applicable_post_types: array of post types the link panel, redirect and sitemap exclusions apply to. Default array( 'post', 'page' ).
  • lh_page_links_to_is_valid_link_url: ( bool $valid, string $url ). Whether a value counts as a valid link. The default accepts full http or https URLs with a host. It is used both when saving and when reading, so a stricter or looser rule applies to both.
  • lh_page_links_to_return_link_meta_key: the post meta key the link is stored under. Default _lh_page_links_to-link_url. The block editor panel is given the filtered key.
  • lh_page_links_to_init_plugin: return false to stop the plugin adding any of its hooks.

Actions

  • lh_page_links_to_redirect_url: ( int $post_id, string $url ). Fires just before a visitor is redirected, for example to log redirects.

Integrations

  • wp_sitemaps_posts_query_args: posts with a valid link are left out of the core XML sitemap.
  • lh_html_sitemap_get_excluded_post_ids: posts with a valid link are left out of the LH HTML Sitemap.

Data

The link is stored in a single post meta value, _lh_page_links_to-link_url, registered with show_in_rest so the block editor can read and write it. Only valid links are stored: an empty or invalid value deletes the meta instead. Editing it requires permission to edit that post. There are no custom tables, options or cron jobs.

Public method

LH_Page_links_to_plugin::get_link( $post ) takes a post or post ID and returns its link URL, or false if it has no valid link. Use it in a theme to link a post title straight to its destination.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.