WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Bbpress Latest Discussion] script loading (1 post)

  1. scribu
    Member
    Posted 4 years ago #

    Hello,

    Thanks for the neat plugin. I have one issue with it: the admin CSS and JS files are loaded on each admin page, insted of only on the plugin's settings page.

    Here's a better version of the bbld_css() function, in BBpress.php:

    function bbld_css() {
    	global $plugin_dir, $pagenow;
    
    	if ( 'options-general.php' == $pagenow && 'bbpress-latest-discussion/BBpress.php' == $_GET['page'] )
    		echo '
    
    			<link rel="stylesheet" href="' . get_option('siteurl') . '/wp-content/plugins/'.$plugin_dir.'/style.css" type="text/css" media="screen" />
    
    			<script type="text/javascript" src="' . get_option('siteurl') . '/wp-content/plugins/'.$plugin_dir.'/Bbpress.js"></script>
    
    		';
    
    }

    http://wordpress.org/extend/plugins/bbpress-latest-discussion/

Topic Closed

This topic has been closed to new replies.

About this Topic