Commit 6df14680 authored by Erick Hitter's avatar Erick Hitter

Allow filter to short-circuit redirect

parent d8ac98e4
Pipeline #1008 passed with stages
in 3 minutes and 16 seconds
......@@ -194,10 +194,14 @@ class ETH_Redirect_To_Latest_Post {
* @param array $redirect Array of redirect destination and status code.
* @param array|WP_Post $latest Post object or empty array if no posts found.
* @param WP $r WP object.
* @return string
* @return array|null
*/
$redirect = apply_filters( 'eth_redirect_to_latest_post_redirection', $redirect, $latest, $r );
if ( null === $redirect ) {
return null;
}
return (object) $redirect;
}
......
......@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: ETH Redirect to Latest Post 0.3\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/eth-redirect-to-latest\n"
"POT-Creation-Date: 2019-05-13 01:31:41+00:00\n"
"POT-Creation-Date: 2019-05-13 01:45:54+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -34,11 +34,11 @@ msgstr ""
msgid "latest"
msgstr ""
#: inc/class-eth-redirect-to-latest-post.php:235
#: inc/class-eth-redirect-to-latest-post.php:239
msgid ""Latest post" slug"
msgstr ""
#: inc/class-eth-redirect-to-latest-post.php:249
#: inc/class-eth-redirect-to-latest-post.php:253
#. translators: 1. Default slug, wrapped in a <code> tag.
msgid ""
"Set the slug that will redirect to the latest published post. The default "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment