Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register_editable_option() #57

Open
scribu opened this issue Feb 19, 2012 · 1 comment
Open

register_editable_option() #57

scribu opened this issue Feb 19, 2012 · 1 comment
Labels

Comments

@scribu
Copy link
Owner

scribu commented Feb 19, 2012

Currently, all the details about editing a particular option need to be passed on ajax each request.

It would be safer and more efficient to register them beforehand and just pass the key. Here's how it would work:

First, call register_editable_option() in your functions.php file:

register_editable_option( array(
  'key' => 'whatever',
  'type' => 'rich',
  'default' => 'foobar'
) );

Then, in your template files, just pass the key:

<?php editable_option( 'whatever' ); ?>
@scribu
Copy link
Owner Author

scribu commented Mar 11, 2012

On the other hand, having to register potentially dozens of options before using them can get tedious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant