Skip to content

Instantly share code, notes, and snippets.

@ramiabraham
Last active September 12, 2016 21:07
Show Gist options
  • Save ramiabraham/951d9f7f29c859ddc6c9c6d09ae88cb2 to your computer and use it in GitHub Desktop.
Save ramiabraham/951d9f7f29c859ddc6c9c6d09ae88cb2 to your computer and use it in GitHub Desktop.
Restore wp-admin menu and bar visibility on NF3+ screens.
jQuery( document ).ready( function( $ ) {
// Container
$( '.wp-admin.ninja-forms-app #nf-pre-builder' ).css( 'position', 'relative' );
$( '.wp-admin.ninja-forms-app #nf-pre-builder' ).css( 'top', '32px' );
$( '.wp-admin.ninja-forms-app #nf-pre-builder' ).css( 'left', '100px' );
// Restore menus
$( '.wp-admin.ninja-forms-app #nf-builder' ).css( 'z-index', '1' );
$( '.wp-admin.ninja-forms-app #nf-builder' ).css( 'top', '32px' );
$( '.wp-admin.ninja-forms-app #nf-builder' ).css( 'left', '160px' );
$( '.wp-admin.ninja-forms-app #nf-builder' ).css( 'box-shadow', 'none' );
// Restore admin menus and footer
$( '.wp-admin.ninja-forms-app #adminmenumain' ).css( 'display', 'block' );
$( '.wp-admin.ninja-forms-app #wpfooter' ).css( 'display', 'block' );
} );
<?php
/**
* Plugin Name: Ninja Forms Admin Bar and Menu Visibility
* Plugin URI: https://dennys.com
* Description: Restores the WordPress admin menu, and menu bar, in wp-admin on NF 3+ screens.
* Author: ramiabraham
* Author URI: https://dennys.com
* Version: 1.0
* Text Domain: nf-display-tweak
* Domain Path: languages
*
* This plugin is distributed under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* any later version.
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
function dennys_nf_display_tweak() {
$screen = get_current_screen();
$screen_id = $screen->id;
$src = plugins_url( 'nf-display-tweak.js', __FILE__ );
wp_register_script( 'nf-display-tweak', $src, array( 'jquery' ), null, true );
if ( $screen_id === 'toplevel_page_ninja-forms' ) {
wp_enqueue_script( 'nf-display-tweak' );
}
}
add_action('admin_enqueue_scripts', 'dennys_nf_display_tweak', 9999 );
@salcode
Copy link

salcode commented Sep 12, 2016

The canonical URL is https://www.dennys.com/ not https://dennys.com 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment