Forums

[Plugin: Contact Form 7] WordPress MU Compatible (2 posts)

  1. mwaterous
    Member
    Posted 2 years ago #

    Might I make a suggestion to help improve the compatibility of your plugin with ยต (especially if the code merge happens to go through)?

    Change the following:

    function wpcf7_wp_head() {
    	$stylesheet_url = wpcf7_plugin_url( 'stylesheet.css' );
    	echo '<link rel="stylesheet" href="' . $stylesheet_url . '" type="text/css" />';
    
    	if ( 'rtl' == get_bloginfo( 'text_direction' ) ) {
    		$stylesheet_rtl_url = wpcf7_plugin_url( 'stylesheet-rtl.css' );
    		echo '<link rel="stylesheet" href="' . $stylesheet_rtl_url . '" type="text/css" />';
    	}
    }
    
    if ( WPCF7_LOAD_CSS )
    	add_action( 'wp_head', 'wpcf7_wp_head' );

    ...to...

    function wpcf7_wp_styles () {
    
    	if ( file_exists(TEMPLATEPATH . '/contact-form.css') ) {
    		wp_enqueue_style('contact-form', get_stylesheet_directory_uri().'/contact-form.css', false, '2.0.4', 'screen');
    	} else {
    		wp_enqueue_style('contact-form', plugins_url('contact-form-7/stylesheet.css'), false, '2.0.4', 'screen');
    		if ( 'rtl' == get_bloginfo('text_direction') )
    			wp_enqueue_style('contact-form-rtl', plugins_url('contact-form-7/stylesheet-rtl.css'), false, '2.0.4', 'screen');
    	}
    
    }
    
    if ( WPCF7_LOAD_CSS )
    	add_action( 'wp_print_styles', 'wpcf7_wp_styles' );

    This way member blogs can override the default style sheet. This is just one possible location, it might even be better to have it look in their uploads path. Except then you have to deal with whether or not uploads are placed in dated directories or not. Either way, just a suggestion. :)

  2. Takayuki Miyoshi
    Member
    Posted 2 years ago #

    Thanks. I'll consider it for next release.

Topic Closed

This topic has been closed to new replies.

About this Topic