Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 512573

javascript conflicts with other plugins and solution

$
0
0

Replies: 0

the solution is simple.
Just include the various styles and javavascript only in the plugin page.


if (!defined('ABSPATH')) {
    exit;
}

define('SAVE_CF7_ADMIN_MENU','save_contact_form_7'); // define menu slug name

.
.
.

   if (!function_exists('nimble_scripts')) {

        // enqueue script and style only in save cf7 page
        function nimble_scripts($hook) {

		if ($hook != 'toplevel_page_'.SAVE_CF7_ADMIN_MENU) {
			return;
		}
  .
  .
  .


 if (!function_exists("nimble_menu")) {

        function nimble_menu() {
            $page_title = 'Save Contact Form 7';
            $menu_title = 'Save CF7';
            $capability = 'manage_options';
            $menu_slug = SAVE_CF7_ADMIN_MENU; // <-- use menu slug definition
            $function = 'nimble_populate_page';
  • This topic was modified 2 minutes ago by  andreamk.

Viewing all articles
Browse latest Browse all 512573

Trending Articles