Version Description
- Fixed (Draft preview issue for custom post types + some PHP Warnings)
Download this release
Release Info
Developer | sasiddiqui |
Plugin | Custom Permalinks |
Version | 0.8 |
Comparing to | |
See all releases |
Code changes from version 0.7.28 to 0.8
- custom-permalinks.php +13 -9
- readme.txt +10 -4
custom-permalinks.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Custom Permalinks
|
4 |
-
Plugin URI:
|
5 |
Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
|
6 |
Description: Set custom permalinks on a per-post basis
|
7 |
-
Version: 0.
|
8 |
Author: Michael Tyson
|
9 |
Author URI: http://atastypixel.com/blog
|
10 |
Text Domain: custom-permalinks
|
11 |
*/
|
12 |
|
13 |
-
/* Copyright 2008-
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
@@ -188,7 +188,7 @@ function custom_permalinks_request($query) {
|
|
188 |
if( $posts[0]->post_type == 'page' ) {
|
189 |
$originalUrl = "?page_id=" . $posts[0]->ID;
|
190 |
} else {
|
191 |
-
$originalUrl = "?p=" . $posts[0]->ID;
|
192 |
}
|
193 |
} else {
|
194 |
$originalUrl = preg_replace( '@/+@', '/', str_replace( trim( strtolower($posts[0]->meta_value),'/' ),
|
@@ -302,7 +302,7 @@ function custom_permalinks_trailingslash($string, $type) {
|
|
302 |
*/
|
303 |
function custom_permalink_get_sample_permalink_html($html, $id, $new_title, $new_slug) {
|
304 |
$permalink = get_post_meta( $id, 'custom_permalink', true );
|
305 |
-
$post =
|
306 |
|
307 |
ob_start();
|
308 |
?>
|
@@ -388,15 +388,19 @@ function custom_permalinks_page_options() {
|
|
388 |
* @since 0.1
|
389 |
*/
|
390 |
function custom_permalinks_term_options($object) {
|
391 |
-
$
|
|
|
392 |
|
393 |
-
|
394 |
$originalPermalink = ($object->taxonomy == 'post_tag' ?
|
395 |
custom_permalinks_original_tag_link($object->term_id) :
|
396 |
custom_permalinks_original_category_link($object->term_id) );
|
397 |
}
|
398 |
-
|
399 |
-
|
|
|
|
|
|
|
400 |
|
401 |
// Move the save button to above this form
|
402 |
wp_enqueue_script('jquery');
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Custom Permalinks
|
4 |
+
Plugin URI: https://wordpress.org/plugins/custom-permalinks/
|
5 |
Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
|
6 |
Description: Set custom permalinks on a per-post basis
|
7 |
+
Version: 0.8
|
8 |
Author: Michael Tyson
|
9 |
Author URI: http://atastypixel.com/blog
|
10 |
Text Domain: custom-permalinks
|
11 |
*/
|
12 |
|
13 |
+
/* Copyright 2008-2017 Michael Tyson <michael@atastypixel.com> and Sami Ahmed Siddiqui <sami@samisiddiqui.com>
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
188 |
if( $posts[0]->post_type == 'page' ) {
|
189 |
$originalUrl = "?page_id=" . $posts[0]->ID;
|
190 |
} else {
|
191 |
+
$originalUrl = "?post_type=".$posts[0]->post_type."&p=" . $posts[0]->ID;
|
192 |
}
|
193 |
} else {
|
194 |
$originalUrl = preg_replace( '@/+@', '/', str_replace( trim( strtolower($posts[0]->meta_value),'/' ),
|
302 |
*/
|
303 |
function custom_permalink_get_sample_permalink_html($html, $id, $new_title, $new_slug) {
|
304 |
$permalink = get_post_meta( $id, 'custom_permalink', true );
|
305 |
+
$post = get_post($id);
|
306 |
|
307 |
ob_start();
|
308 |
?>
|
388 |
* @since 0.1
|
389 |
*/
|
390 |
function custom_permalinks_term_options($object) {
|
391 |
+
if ( is_object($object) && isset($object->term_id) ) {
|
392 |
+
$permalink = custom_permalinks_permalink_for_term($object->term_id);
|
393 |
|
394 |
+
if ( $object->term_id ) {
|
395 |
$originalPermalink = ($object->taxonomy == 'post_tag' ?
|
396 |
custom_permalinks_original_tag_link($object->term_id) :
|
397 |
custom_permalinks_original_category_link($object->term_id) );
|
398 |
}
|
399 |
+
|
400 |
+
custom_permalinks_form($permalink, $originalPermalink);
|
401 |
+
} else {
|
402 |
+
custom_permalinks_form('');
|
403 |
+
}
|
404 |
|
405 |
// Move the save button to above this form
|
406 |
wp_enqueue_script('jquery');
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== Custom Permalinks ===
|
2 |
|
3 |
-
Contributors:
|
4 |
Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
|
5 |
-
Tags: permalink, url, link, address, custom, redirect
|
6 |
Requires at least: 2.6
|
7 |
-
Tested up to: 4.
|
8 |
-
Stable tag: 0.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -24,6 +24,8 @@ This plugin is only useful for assigning custom permalinks for *individual* post
|
|
24 |
It will not apply whole permalink structures, or automatically apply a category's custom permalink to the posts
|
25 |
within that category.
|
26 |
|
|
|
|
|
27 |
== Installation ==
|
28 |
|
29 |
1. Unzip the package, and upload `custom-permalinks` to the `/wp-content/plugins/` directory
|
@@ -32,6 +34,10 @@ within that category.
|
|
32 |
|
33 |
== Changelog ==
|
34 |
|
|
|
|
|
|
|
|
|
35 |
= 0.7.28 =
|
36 |
|
37 |
* Fixed draft preview issue(posts + pages)
|
1 |
=== Custom Permalinks ===
|
2 |
|
3 |
+
Contributors: sasiddiqui, michaeltyson
|
4 |
Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
|
5 |
+
Tags: permalink, url, link, address, custom, redirect, custom post type
|
6 |
Requires at least: 2.6
|
7 |
+
Tested up to: 4.7
|
8 |
+
Stable tag: 0.8
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
24 |
It will not apply whole permalink structures, or automatically apply a category's custom permalink to the posts
|
25 |
within that category.
|
26 |
|
27 |
+
> If anyone wants the different Structure Tags for their Post types or use symbols in the URLs So, use the [Permalinks Customizer](https://wordpress.org/plugins/permalinks-customizer/) which is a fork of this plugin and contains the enhancement of this plugin.
|
28 |
+
|
29 |
== Installation ==
|
30 |
|
31 |
1. Unzip the package, and upload `custom-permalinks` to the `/wp-content/plugins/` directory
|
34 |
|
35 |
== Changelog ==
|
36 |
|
37 |
+
= 0.8 =
|
38 |
+
|
39 |
+
* Fixed (Draft preview issue for custom post types + some PHP Warnings)
|
40 |
+
|
41 |
= 0.7.28 =
|
42 |
|
43 |
* Fixed draft preview issue(posts + pages)
|