• Resolved Ross Wintle

    (@magicroundabout)


    Hi,

    I’m sure I’m missing something really obvious here.

    I’m using plugin v1.1. on WordPress v3.3.2. It’s a bit of a weird config because I’m running it on a sub-domain-based Multi-site on my localhost, but I can’t see that that would make a difference in my problem.

    I’ve got an editor field that’s not doing wpautop, despite the wpautop setting being true. It’s not just a display issue. I’ve checked the database and the option is not being set with p tags.

    My code looks like:

    function optionsframework_options() {
    
    	$wp_editor_settings = array(
    		'wpautop' => true, // Default
    		'textarea_rows' => 5,
    		'tinymce' => array( 'plugins' => 'wordpress' )
    	);
    
    	$options = array();
    
    	$options[] = array(
    		'name' => 'Front Page',
    		'type' => 'heading');
    
    	$options[] = array(
    		'name' => 'Front Page Text',
    		'desc' => 'Text for the front page image section',
    		'id' => 'front_page_text',
    		'type' => 'editor',
    		'std' => "Standard text\n\non two lines",
    		'settings' => $wp_editor_settings );
    
    	return $options;
    
    }

    Any thoughts on what might be stopping wpautop working?

    Thanks

    http://wordpress.org/extend/plugins/options-framework/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ross Wintle

    (@magicroundabout)

    Oh, OK. Fixed this.

    Didn’t realise that wpautop intentionally stores data in database without <p> tags (apparently?), and you need to apply filters to the option to get <p>’s added back in…something like:

    echo apply_filters('the_content', of_get_option('front_page_text'));

    Wow, thanks so much for posting this solution. I thought I was missing something too – well, I guess I was! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Options Framework] wpautop not working’ is closed to new replies.