Timeline for Limiting the number of words or characters in the slug/permalink
Current License: CC BY-SA 3.0
21 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 17, 2012 at 13:05 | comment | added | mor7ifer | @MichaelWilliam Let me repeat myself. I am not going to support this question. It does not pertain to how the code works, it pertains to how you implemented my code, so if you need help with it, open another question, and someone else will help. | |
Jun 17, 2012 at 1:13 | comment | added | BobGCA2 | Ok, @m0r7if3r, I understand. I was trying if(taxonomy_exists('post_tag') || taxonomy_exists('category')), but is not working. | |
Jun 17, 2012 at 1:03 | comment | added | mor7ifer | @MichaelWilliam Are you familiar with the concept of conditional application? Only add the filter where it's needed, and remove it immediately afterwards. That is all you're going to get out of me here, as there are already too many comments, and the issue is not with the code, but rather your implementation. I suggest you put in the research effort, and if you can't solve it, open a new question. | |
Jun 17, 2012 at 0:46 | comment | added | BobGCA2 | There are, sorry. The question should be made to @m0r7if3r, who created the function wpse52690_limit_length. | |
Jun 17, 2012 at 0:31 | comment | added | BobGCA2 | @toscho Slug is filtering of tags and categories too. Is there any way to make this code do not filter the slug of tags and categories? | |
May 22, 2012 at 1:16 | comment | added | fuxia♦ | @MichaelWilliam That's not my code, m0r7if3r has written it. :) | |
May 20, 2012 at 18:52 | vote | accept | BobGCA2 | ||
May 20, 2012 at 18:50 | comment | added | BobGCA2 | @toscho Sorry. I really am "abusing" their good will, lol. I'm actually enjoying that you're online. For you it is easier to change the code, because you created. And I'm just an enthusiast in php, and I am striving to learn more. Thanks for your great help. | |
May 20, 2012 at 17:14 | comment | added | fuxia♦ | @MichaelWilliam See m0r7if3r's answer (and every other answer on our site) as a hint for a possible direction. Do not expect – and do not ask for – complete working code without your own research efforts. | |
May 20, 2012 at 17:13 | comment | added | mor7ifer |
@MichaelWilliam Fixed. I had if( $i != 1 ) where I should have had if( $i != 0 )
|
|
May 20, 2012 at 17:13 | history | edited | mor7ifer | CC BY-SA 3.0 |
edited body
|
May 20, 2012 at 17:08 | comment | added | BobGCA2 | @toscho Ok, now gone. But not added trace in the first words and used only words 3 and not 5. Title: Welcome This is my first post - Slug: mysite.com/welcomethis-is/ | |
May 20, 2012 at 17:06 | comment | added | mor7ifer | @toscho thanks for that fix, I always end up to make some dumb error when I don't test code lol | |
May 20, 2012 at 16:48 | comment | added | fuxia♦ |
@MichaelWilliam The add_filter was missing the last argument, so WordPress didn't pass all three parameters to the callback. It is fixed now.
|
|
May 20, 2012 at 16:47 | history | edited | fuxia♦ | CC BY-SA 3.0 |
made sure 3 args are passed
|
May 20, 2012 at 16:44 | comment | added | BobGCA2 | @m0r7if3r Gave error - Warning: Missing argument 2 for wpse52690_limit_length() in /functions.php on line 200 | |
May 20, 2012 at 14:58 | comment | added | fuxia♦ | Ah, sorry. missed the scroll bar. | |
May 20, 2012 at 14:57 | history | edited | mor7ifer | CC BY-SA 3.0 |
added 3 characters in body
|
May 20, 2012 at 14:57 | comment | added | mor7ifer |
@toscho You must have missed the last line, it returns $new_title . Thanks for the tip on strlen() , never knew that.
|
|
May 20, 2012 at 14:53 | comment | added | fuxia♦ |
You should use mb_strlen() … and return something. A string would be useful. :)
|
|
May 20, 2012 at 13:14 | history | answered | mor7ifer | CC BY-SA 3.0 |