Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can i progammatically see if the page that is currently open in the wordpress admin is 'About-Me';

I wish to run specific functions depending on the page the user is editing in the wordpress-admin.

share|improve this question
add comment

1 Answer

You can use the $post global.

Somewhere inside of a function, hooked in appropriately to the post-edit screen:

// Globalize the $post variable
global $post;
// check to see that we are on a page, with a title "About Me"
if ( 'page' == $post->post_type && 'About Me' == $post->post_title ) {
    // This is the "About Me" page;
    // do something
}
share|improve this answer
add comment

Your Answer

 
discard

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.