[wp-hackers] Select pages's associated menu items in a specific menu

Mike Schinkel mikeschinkel at newclarity.net
Wed Jul 28 02:02:51 UTC 2010


On Jul 27, 2010, at 8:14 PM, Lox wrote:
> 2010/7/28 Mike Schinkel <mikeschinkel at newclarity.net>:
>> So do you mean you have menus where a post may be referenced several times
> 
> Sure, but the problem is with posts that may be referenced several
> times IN MULTIPLE MENUS.

I just wanted to understand what your requirements were.  (BTW, do you frequently have menu options that point to the same post? Hmm..)

I was struggling with what you wanted and also with the solution for what I think you are looking for so I decided to do it in "my native language" first, which would be SQL. :) 

Can you verify that this gives you the results you are looking for?

http://gist.github.com/493178

Copy the raw file to test.php in the root of your site and call it like this (replacing the URL params with your values of course):

http://example.com/test.php?menu=3&post=2

Let me know if this is ultimately what you want (I know it's better to use the WordPress API, but we'll get there...)

-Mike

 



More information about the wp-hackers mailing list