codemuffin

Fix for WP Plugin: 301 Redirects

Jun 14th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. // Fix for https://wordpress.org/plugins/301-redirects/
  2. // Issue: Plugin CSS and JS files are enqueued on every admin page, not just the plugin settings page
  3. // Edit from line 43 of 301-redirects.php:
  4.  
  5. function load_301_redirect_assets($hook) {
  6.     if ( $hook === 'settings_page_301-redirects' ) {
  7.         wp_enqueue_style( 'redirect_301_bootstrap_css', plugin_dir_url( __FILE__ ) . 'lib/bootstrap-3.3.4.css', false, '1.0.0' );
  8.         wp_enqueue_style(  'redirect_301_custom_css', plugin_dir_url( __FILE__ ) . 'style.css', false, '1.0.0' );
  9.         wp_enqueue_script( 'bootstrap', plugin_dir_url( __FILE__ ) . 'lib/bootstrap-3.3.4.js', array(), '1.0.0', true );
  10.     } else return;
  11. }
Add Comment
Please, Sign In to add comment