[wp-hackers] Get URL of page with shortcode

Eddie O'Leary eddie at teamcolab.com
Wed Feb 2 05:59:48 UTC 2011

It seems that you could put the following code inside the shortcode

global $post;
$url = get_permalink($post->ID);

$url will equal the permalink of the post that is parsing the shortcode.



On Tue, Feb 1, 2011 at 10:41 PM, Ryan Bilesky <rbilesky at gmail.com> wrote:

> I am looking for a way in my plugin the get the URL for the page which
> contains a specific shortcode for my plugin, is there an easy way to do
> this, or do I need to do a query with wpdb against the page content?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

Eddie O'Leary
CO+LAB Multimedia

201 W 7th St.
Richmond, VA 23224

804-433-3582 office
804-475-4502 cellular

More information about the wp-hackers mailing list