@@ -30,8 +30,25 @@ For example, http://example.com/?p=123 becomes http://example.com/p/123/.
No, shortlinks use the posts' IDs, so aren't available for modification.
### Why aren't redirects validated? ###
Sites may use plugins that allow a post object's permalink to be set to an external URL, and this plugin is designed to respect those plugins.
If you wish to validate the redirects issued by this plugin, you can use the `eth_simple_shortlinks_redirect_url` filter to apply `wp_validate_redirect()` to the destination URL.
### After upgrading to 0.6, redirects stopped working ###
Beginning with release 0.6, before performing a redirect, the plugin checks that the post type and post status are supported. Previously, these checks were only applied when overriding an object's shortlink.
If, after upgrading, redirects stop working, use the `eth_simple_shortlinks_allowed_post_types` and `eth_simple_shortlinks_allowed_post_statuses` filters to permit additional types and statuses, or use the `eth_simple_shortlinks_verify_requested_post_support` filter to disable the supports checks.
## Changelog ##
### 0.6 ###
* Introduce filters in redirection handling.
* Apply supported post-type and post-status checks before redirecting.
* Conform to WordPress VIP's Coding Standards.
### 0.5 ###
* Admin notices when permalinks won't support the plugin
* Disable plugin functionality when permalink structure is incompatible
...
...
@@ -39,3 +56,9 @@ No, shortlinks use the posts' IDs, so aren't available for modification.
### 0.4 ###
* Initial release
## Upgrade Notice ##
### 0.6 ###
Applies supported post-type and post-status checks before performing redirect. If, after upgrading, redirects stop working, see the "After upgrading to 0.6, redirects stopped working" section of the FAQ.
$message=sprintf(__('Please visit the <a href="%1$s">Permalinks</a> settings page to refresh your permalinks. Doing so will add the rules this plugin requires.','eth_simple_shortlinks'),admin_url('options-permalink.php'));
}
}else{
$message=sprintf(__('Please enable <a href="%1$s">pretty permalinks</a>, otherwise disable this plugin as it is not compatible with "Plain" permalinks.','eth_simple_shortlinks'),admin_url('options-permalink.php'));
* Shortcut for using the shortlink outside of this plugin's considerations
* Plugin Name: ETH Simple Shortlinks
* Plugin URI: https://ethitter.com/plugins/
* Description: Simple non-GET shortlinks using post IDs
* Author: Erick Hitter
* Version: 0.6
* Author URI: https://ethitter.com/
* Text Domain: eth_simple_shortlinks
* Domain Path: /languages/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
functioneth_simple_shortlinks_get($post_id){
if(!did_action('wp_loaded')){
_doing_it_wrong(__FUNCTION__,__('Shortlinks cannot be generated until after <code>wp_loaded</code>; this ensures that all post types are registered.','eth_simple_shortlinks'),'0.3');