Quick Q's Regarding Finding Tokens In Post & Post ID
-
Hey,
2 quick questions.
1.) What is the best native method to retrieve a post ID
outside of the loop? I have tried:
global $post
$post-ID; to no avail2.) What is a native wordpress method to find a token in a post, such as trying to determine if the post has the following token:
[level=5]
within it?
I am using regex/explode php functions inside the loop as I need to maniuplate the post based on data in those tokens, but it is slowing down the wordpress site. I can’t find any native functions that allow me to pinpoint whether a post has a token and, how to use a regex type function to grab whatever is inside that token.
In short, if you had to sniff out if a wordpress post has the token:
[level=5]
AND determine the value after level=
what would you do? In regular php it’s easy for me, but trying to do these functions in wordpress without slowing down the site is difficult.
I can post code upon request.
TY.
- The topic ‘Quick Q's Regarding Finding Tokens In Post & Post ID’ is closed to new replies.