wphackers at jamietalbot.com
Tue Apr 19 10:05:24 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Yep, you're right, there was no checking to see if a post-name had been
specified. Your solution is best, and only adds one line before the
post-name replacement replacement:
if ($specified = $_REQUEST['post_name']) return $id;
or somesuch. Probably don't even need the assignment statement really.
I think this should cover it: Do nothing when the user has specified
the post-name themselves and assume they know what they're doing,
otherwise just sanitise the post title as usual. Like you say, the
other two solutions seem a bit of an overkill.
Cheers for the info!
Alex King wrote:
> Hi Jamie--
> I've run into a problem with Singular: it overwrites any selected post
> slug with the generated slug from the post title.
> I'm looking at 3 possible solutions:
> 1. Check for $_POST['post_name'] which should still be around. (I think
> this is best)
> 2. Retrieve both post_name and post_title and compare them before
> overwriting - could be complicated.
> 3. Retrieve post_name and do some regex to see if the last digit is a
> number, yada-yada-yada.
> I'm going to implement #1 as #2 and 3 seem like poor solutions to me.
> Perhaps the rest of you have better ideas?
> On Apr 12, 2005, at 5:08 AM, Jamie Talbot wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> Alex King wrote:
>> | Thanks Jamie. I guess this is easier to update than having to re-hack
>> | the source. :)
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the wp-hackers