WordPress.org

Ready to get started?Download WordPress

Forums

Options Framework
[resolved] wpautop not working (3 posts)

  1. magicroundabout
    Member
    Posted 2 years ago #

    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/

  2. magicroundabout
    Member
    Posted 2 years ago #

    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'));

  3. Mary
    Member
    Posted 2 years ago #

    Wow, thanks so much for posting this solution. I thought I was missing something too - well, I guess I was! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic