0

I want to redirect users to a page on which a particular short-code has been used after they login. So basically I want to know how can I get the permalink of that particular page on which my plugins specific short code has been used?

1
  • 1
    Add some code to clarify your question. I read it twice but still dont understand ur situcation Dec 21, 2015 at 10:15

1 Answer 1

0

I think that the very best approach would be to store that page on a option.

Anyway, if you want to get the pages where a shortcode has been used, you can use the search parameter (s) of WP_Query class (or get_posts() function). Basically, this parameter performs a LIKE query, so it could be useful to search for shortcodes like this:

$args = array(
    's'         => '[myshortcode',
    'post_type' => 'pages'
);

$pages_with_myshortcode = get_posts( $args );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.