WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to assign a variable either from my template file or otherwise which I can then access within the post editor.

Any ideas?

share|improve this question
what do you mean specifically by "access within post editor"? – Milo May 25 '11 at 22:32

There is no built-in mechanism to access php in the post editor. The best solution would be to create a custom shortcode which you can use to access the variable. This is probably the safest and most secure method available.

share|improve this answer

You haven't been too descriptive but if you mean that you would be able to edit a variable in the Post > Edit screen then you should really be using Custom Fields. These variables would be stored / retrieved as post meta-data.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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