Using wordpress get_option on plugin to retrieve a text value and display it

The $options variable holds my wordpress plugin options. I've seen people print_r but I'm not sure how to just echo it in a tag for instance.

$options = get_option('simpledir_options', array() ); print_r($options); 

This outputs:

Array ( [custom_css_styles] => disable [custom_css_textarea] => a{color:hotpink;} ) 

How can I just get the css value of a{color:hotpink;}?

1

1 Answer

you need to load 'wp-config.php' properly to load 'get_option' function into a page. like:

 require_once '../../../wp-config.php'; 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like