Overview

Packages

  • ACF
  • Automation
    • Actions
    • Activation
    • LeadProfile
    • Menus
    • Queries
    • Rules
    • Triggers
  • CTA
    • Activation
    • AJAXListeners
    • Cloning
    • Core
    • Display
    • EditPage
    • Enqueues
    • GPLSettings
    • LeadsProfile
    • Loading
    • Menus
    • Notices
    • PlacementMetabox
    • PostType
    • Templates
    • Tracking
    • Variations
    • YOAST
  • InboundPro
    • Activation
    • AdminAJAX
    • AutoLoading
    • Cron
    • DataInterface
    • FieldMapping
    • Funnels
    • InboundNowAPI
    • Installer
    • LeadStatuses
    • Menus
    • Notifications
    • Ouath
    • Reports
    • Settings
    • Tracking
    • Translations
    • Updates
  • LandingPages
    • Activation
    • DataInterfaces
    • Management
    • Menus
    • NeedsAttention
    • Notices
    • Sidebars
    • Templates
    • Tracking
    • Variations
    • WelcomeScreen
    • Widgets
  • Leads
    • Activation
    • Akismet
    • BranchControl
    • BulkActions
    • Dashboard
    • Management
    • Notifications
    • Settings
    • Tracking
    • UserProfile
    • WPLogin
  • Mailer
    • Activation
    • Admin
    • ClickTracking
    • DataInterface
    • InboundForms
    • Leads
    • Management
    • Notifications
    • Scheduling
    • Sending
    • Settings
    • ShortcodesAndTokens
    • SparkPost
    • Templates
    • Unsubscribes
    • Variations
    • YoastSEO
  • None
  • Shared
    • APIs
    • CPT
    • DatabaseRoutines
    • DebugTricks
    • DoubleOptin
    • EventManagement
    • FieldMapping
    • InboundForms
    • LeadSorage
    • MarketingButton
    • Menus
    • Notifications
    • Shortcodes
    • ShortcodesAndTokens
    • StandAloneLicensing
    • Tracking
    • VisualEditor
  • xDepreciated

Classes

  • CTA_Activation
  • CTA_Activation_Update_Routines
  • CTA_Admin_Notices
  • CTA_Ajax_Listeners
  • CTA_Clone_Post
  • CTA_Conversion_Tracking
  • CTA_Dynamic_Widget
  • CTA_Enqueues
  • CTA_Load_Extensions
  • CTA_Menus
  • CTA_Metaboxes
  • CTA_Metaboxes_Global
  • CTA_Post_Type
  • CTA_Render
  • CTA_Settings
  • CTA_Static_Widget
  • CTA_Template_Manager
  • CTA_Template_Manager_List
  • CTA_Variations
  • CTA_WordPress_Leads
  • CTA_WordPress_SEO
  • Inbound_Ajax
  • Inbound_Akismet
  • Inbound_Analytics
  • Inbound_API
  • Inbound_API_Keys_Generation
  • Inbound_API_Keys_Table
  • Inbound_API_Wrapper
  • Inbound_Asset_Loader
  • Inbound_Automation_Action_Add_Remove_List
  • Inbound_Automation_Action_Add_Remove_Tag
  • Inbound_Automation_Action_Create_Lead
  • Inbound_Automation_Action_Create_User
  • Inbound_Automation_Action_Kill_Tasks
  • Inbound_Automation_Action_Relay_Data
  • Inbound_Automation_Action_Send_Email
  • Inbound_Automation_Action_Wait
  • Inbound_Automation_Activation
  • Inbound_Automation_Activation_Update_Routines
  • Inbound_Automation_Adminbar
  • Inbound_Automation_Lead_Profile
  • Inbound_Automation_Loader
  • Inbound_Automation_Plugin
  • Inbound_Automation_Post_Type
  • Inbound_Automation_Processing
  • Inbound_Automation_Query_Lead
  • Inbound_Automation_Query_User
  • Inbound_Automation_Trigger_inbound_double_optin_confirm
  • Inbound_Automation_Trigger_inbound_store_lead_post
  • Inbound_Automation_Trigger_inbound_track_link
  • Inbound_Automation_Trigger_Publish_Post
  • Inbound_Automation_Trigger_Save_Post_Deactivated
  • Inbound_Automation_Trigger_Set_Object_Terms
  • Inbound_Automation_Trigger_Update_Lead
  • Inbound_Automation_Trigger_User_Register
  • Inbound_Calls_To_Action_Plugin
  • Inbound_Confirm_Double_Optin
  • Inbound_Cron
  • Inbound_CTA_Quick_View
  • Inbound_Customizer
  • Inbound_Debug_Scripts
  • Inbound_Email_Meta
  • Inbound_Email_Preview
  • Inbound_Email_Template_Shortcodes
  • Inbound_Event_Report
  • Inbound_Events
  • Inbound_Events_Report
  • Inbound_Extension_Loads
  • Inbound_Forms
  • Inbound_Funnel_Reporting
  • Inbound_Impressions_Report
  • Inbound_Landing_Pages_Plugin
  • Inbound_Lead_Statuses
  • Inbound_Leads
  • Inbound_Leads_Custom_fields
  • Inbound_Leads_Plugin
  • Inbound_License
  • Inbound_List_Double_Optin
  • Inbound_Load_Shared
  • Inbound_Logging_Automation
  • Inbound_Login
  • Inbound_Mail_Daemon
  • Inbound_Mailer_ACF
  • Inbound_Mailer_Activation
  • Inbound_Mailer_Activation_Update_Routines
  • Inbound_Mailer_Ajax_Listeners
  • Inbound_Mailer_Clone_Post
  • Inbound_Mailer_Common_Settings
  • Inbound_Mailer_Customizer
  • Inbound_Mailer_Direct_Email_Leads
  • Inbound_Mailer_Enqueues
  • Inbound_Mailer_Forms_Integration
  • Inbound_Mailer_Load_Templates
  • Inbound_Mailer_Menus
  • Inbound_Mailer_Metaboxes
  • Inbound_Mailer_Notifications
  • Inbound_Mailer_Plugin
  • Inbound_Mailer_Post_Type
  • Inbound_Mailer_Scheduling
  • Inbound_Mailer_Settings
  • Inbound_Mailer_SparkPost
  • Inbound_Mailer_Stats_Report
  • Inbound_Mailer_Template_Manager
  • Inbound_Mailer_Template_Manager_List
  • Inbound_Mailer_Tokens
  • Inbound_Mailer_Tracking
  • Inbound_Mailer_Unsubscribe
  • Inbound_Mailer_Variations
  • Inbound_Mailer_WordPress_SEO
  • Inbound_Maintenance_Lists
  • Inbound_Marketing_Button
  • Inbound_Menus_Admin
  • Inbound_Menus_Adminbar
  • Inbound_Metaboxes_Automation
  • Inbound_Metaboxes_Leads
  • Inbound_Notifications
  • Inbound_Now_Store
  • Inbound_Options_API
  • Inbound_Pro_Activation
  • Inbound_Pro_Admin_Ajax_Listeners
  • Inbound_Pro_Automatic_Updates
  • Inbound_Pro_Downloads
  • Inbound_Pro_Notifications
  • Inbound_Pro_Oauth_Engine
  • Inbound_Pro_Plugin
  • Inbound_Pro_Settings
  • Inbound_Quick_View
  • Inbound_Reporting_Templates
  • Inbound_Search_And_Comment_Report
  • Inbound_Shared_ACF_BootStrap
  • Inbound_Shortcodes
  • Inbound_Shortcodes_Cookies
  • Inbound_Shortcodes_Fields
  • Inbound_SparkPost
  • Inbound_SparkPost_Stats
  • Inbound_Template_Utils
  • Inbound_Templating_Engine
  • Inbound_Tracking
  • Inbound_Translation_Updater
  • Inbound_Updater
  • Inbound_Upgrade_For_More_Reports
  • Inbound_Upgrade_Routines
  • Inbound_Visitor_Event_Report
  • Inbound_Visitor_Impressions_Report
  • Inbound_Visitors_Report
  • INBOUNDNOW_EXTEND
  • Landing_Pages_ACF
  • Landing_Pages_Activation
  • Landing_Pages_Activation_Update_Routines
  • Landing_Pages_Admin_Menus
  • Landing_Pages_Admin_Notices
  • Landing_Pages_Install
  • Landing_Pages_Load_Extensions
  • Landing_Pages_Meta
  • Landing_Pages_Metaboxes
  • Landing_Pages_Post_Type
  • Landing_Pages_Row_Actions
  • Landing_Pages_Settings
  • Landing_Pages_Sidebars
  • Landing_Pages_Split_Testing_Stats
  • Landing_Pages_Template_Management
  • Landing_Pages_Template_Switcher
  • Landing_Pages_Templates_List_Table
  • Landing_Pages_Variations
  • LandingPages_Welcome
  • Leads_Activation
  • Leads_Activation_Update_Routines
  • Leads_Admin_Notices
  • Leads_Batch_Processor
  • Leads_Branching
  • Leads_Dashboard
  • Leads_Field_Map
  • Leads_Manager
  • Leads_Post_Type
  • Leads_Settings
  • Leads_Tracking
  • Leads_User_Profile
  • LeadStorage
  • LP_EXTENSION_LICENSENING
  • LP_EXTENSION_UPDATER
  • LP_Variation_Rotation
  • LP_Widget_Conversion_Area

Functions

  • cta_check_active
  • cta_example_template_function
  • cta_load_dynamic_widget
  • CTA_Load_Extensions
  • cta_load_static_widget
  • CTA_Render
  • inbound_add_conversion_to_lead
  • inbound_automation_check_active
  • inbound_automation_load_definitions
  • inbound_automation_metaboxes
  • inbound_automation_processing
  • inbound_color
  • inbound_color_scheme
  • inbound_confirm_email_service_provider
  • inbound_email_kill_ie8
  • inbound_email_load_templates
  • inbound_form_add_lead_list
  • inbound_form_auto_publish
  • inbound_form_delete_transient
  • inbound_form_get_data
  • inbound_form_save
  • inbound_forms_change_columns
  • inbound_forms_cpt
  • inbound_forms_custom_columns
  • inbound_forms_default_content
  • inbound_get_form_names
  • inbound_get_parent_directory
  • inbound_Hex_2_RGB
  • inbound_inbound_email_example_template_function
  • inbound_load_lead_manager
  • inbound_load_token_engine
  • inbound_mailer_acf_integration
  • Inbound_Mailer_Common_Settings
  • Inbound_Mailer_Load_Templates
  • inbound_qtrans_disable
  • inbound_record_log
  • inbound_register_form_role_capabilities
  • inbound_shortcode_alert
  • inbound_shortcode_callout
  • inbound_shortcode_columns
  • inbound_shortcode_content_box
  • inbound_shortcode_divider
  • inbound_shortcode_empty_paragraph_fix
  • inbound_shortcode_four_fifth_columns
  • inbound_shortcode_full_columns
  • inbound_shortcode_gmap
  • inbound_shortcode_icon
  • inbound_shortcode_intro
  • inbound_shortcode_landing_pages
  • inbound_shortcode_leadp
  • inbound_shortcode_list_icons
  • inbound_shortcode_one_fifth_columns
  • inbound_shortcode_one_fourth_columns
  • inbound_shortcode_one_half_columns
  • inbound_shortcode_one_third_columns
  • inbound_shortcode_portfolio
  • inbound_shortcode_pricing
  • inbound_shortcode_profile
  • inbound_shortcode_social_links
  • inbound_shortcode_tabs
  • inbound_shortcode_teaser
  • inbound_shortcode_testimonial
  • inbound_shortcode_three_fifth_columns
  • inbound_shortcode_three_fourth_columns
  • inbound_shortcode_two_fifth_columns
  • inbound_shortcode_two_third_columns
  • inbound_shortcode_video
  • inbound_store_lead
  • inbound_template_brightness
  • inbound_template_color
  • Inbound_Templating_Engine
  • inbound_travis_check
  • inboundnow_add_master_license
  • json_encode_fallback
  • landingpage_fix_known_wp_title_isses
  • landingpages_is_active
  • load_CTA_Settings
  • load_CTA_Template_Manager
  • load_Inbound_API_Keys_Generation
  • load_Inbound_Lead_Statuses
  • load_Inbound_Leads_Custom_fields
  • load_inbound_mail_daemon
  • load_Inbound_Mailer_Settings
  • load_Inbound_Mailer_Template_Manager
  • load_Inbound_Pro_Downloads
  • lp_ab_testing_get_current_variation_id
  • lp_add_option
  • lp_body_class
  • lp_check_active
  • lp_content_area
  • lp_conversion_area
  • lp_discover_important_wrappers
  • lp_footer
  • lp_generate_drowndown
  • lp_get_parent_directory
  • lp_get_value
  • lp_global_config
  • lp_head
  • lp_in_admin_header
  • lp_init
  • lp_list_feature
  • lp_load_widgets
  • lp_main_headline
  • lp_manage_templates
  • lp_move_template_files
  • lp_rebuild_attributes
  • lp_templates_upload
  • mailer_check_active
  • wp_cta_check_active
  • wp_cta_kill_ie8
  • wp_cta_load_calls_to_action
  • wp_leads_get_page_final_id
  • wpl_url_to_postid
  • wpleads_add_lead_to_list
  • wpleads_check_active
  • wpleads_get_lead_lists_as_array
  • Overview
  • Package
  • Class
  1:   2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14:  15:  16:  17:  18:  19:  20:  21:  22:  23:  24:  25:  26:  27:  28:  29:  30:  31:  32:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733: 
<?php
/**
 * Class Inbound_Menus_Adminbar adds top horizontal admin menu support
 * @package Shared
 * @subpackage Menus
 */
class Inbound_Menus_Adminbar {

    static $add_menu;
    static $go_button;
    static $inboundnow_menu_key;
    static $inboundnow_menu_secondary_group_key;
    static $load_forms;
    static $load_landingpages;
    static $load_callstoaction;
    static $load_leads;

    public static function init() {
        // Exit if admin bar not there
        if (!is_user_logged_in() || !is_admin_bar_showing() || !current_user_can('activate_plugins')) {
            return;
        }

        self::$add_menu = true;
        self::$go_button = '<input type="submit" value="' . __('GO', 'inbound-pro') . '" class="inbound-search-go"  /></form>';
        self::$inboundnow_menu_key = 'inbound-admin-bar';
        self::$inboundnow_menu_secondary_group_key = 'inbound-secondary';
        self::hooks();

    }


    /**
     *  Loads Hooks & Filters
     */
    public static function hooks() {

        /* load main hook */
        add_action('admin_bar_menu', array(__CLASS__, 'load_inboundnow_menu'), 98);

        /* add filters here */
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_callstoaction'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_landingpages'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_leads'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_mailer'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_automation'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_forms'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_manage_templates'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_settings'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_analytics'), 10);
        add_filter('inboundnow_menu_primary', array(__CLASS__, 'load_seo'), 10);


        add_filter('inboundnow_menu_secondary', array(__CLASS__, 'load_support'), 10);
        add_filter('inboundnow_menu_secondary', array(__CLASS__, 'load_inbound_hq'), 10);
        add_filter('inboundnow_menu_secondary', array(__CLASS__, 'load_debug'), 10);

        /* Enqueue JS/CSS */
        add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_js_css'));

    }


    /**
     *  Loads the inbound now menu into the admin_bar_menu hook
     */
    public static function load_inboundnow_menu() {
        global $wp_admin_bar;

        $primary_menu_items = apply_filters('inboundnow_menu_primary', array());
        $secondary_menu_items = apply_filters('inboundnow_menu_secondary', array());

        /* Add Parent Nav Menu - Inbound Marketing*/
        $wp_admin_bar->add_menu(array(
            'id' => self::$inboundnow_menu_key,
            'title' => __(' Marketing', 'inbound-pro'),
            'href' => "",
            'meta' => array('class' => 'inbound-nav-marketing', 'title' => 'Inbound Marketing Admin')
        ));


        /** Add Primary Menu Items */
        foreach ($primary_menu_items as $id => $menu_item) {
            /** Add in the item ID */
            $menu_item['id'] = $id;

            /** Add meta target to each item where it's not already set, so links open in new window/tab */
            if (!isset($menu_item['meta']['target'])) {
                $menu_item['meta']['target'] = '_blank';
            }

            /** Add class to links that open up in a new window/tab */
            if ('_blank' === $menu_item['meta']['target']) {

                if (!isset($menu_item['meta']['class'])) {
                    $menu_item['meta']['class'] = '';
                }

                $menu_item['meta']['class'] .= 'inbound-new-tab';
            }

            /** Add menu items */
            $wp_admin_bar->add_node($menu_item);
        }

        //var_dump($wp_admin_bar);exit;

        /* Add Secondary Menu Item Group */
        $wp_admin_bar->add_group(array(
            'parent' => self::$inboundnow_menu_key,
            'id' => self::$inboundnow_menu_secondary_group_key,
            'meta' => array('class' => 'ab-sub-secondary')
        ));

        foreach ($secondary_menu_items as $id => $menu_item) {
            $menu_item['id'] = $id;
            $menu_item['meta'] = (isset($menu_item['meta']) && is_array($menu_item['meta']) ) ? $menu_item['meta'] : array();

            if (!isset($menu_item['meta']['target'])) {
                $menu_item['meta']['target'] = '_blank';
            }

            if ( '_blank' === $menu_item['meta']['target']) {
                if (!isset($menu_item['meta']['class'])) {
                    $menu_item['meta']['class'] = '';
                }

                $menu_item['meta']['class'] .= ' inbound-new-tab';
            }

            $wp_admin_bar->add_node($menu_item);
        }

        /* add lead search */
        if (class_exists('Inbound_Pro_Plugin') && is_admin()) {
            $args = array(
                'id' => 'lead_search',
                'title' => '<i class="fa fa-search" aria-hidden="true" style="font-family:FontAwesome;"></i>',
                'href' => '#lead-search',
                'meta' => array('class' => 'adminbar-leads-search')
            );
            $wp_admin_bar->add_node($args);
        }

    }

    /**
     *  Loads leads menu items
     */
    public static function load_leads($menu_items) {
        /* Check if Leads Active */
        if (!function_exists('wpleads_check_active')) {
            return $menu_items;
        }

        $leads_key = 'inbound-leads';
        self::$load_forms = true;
        self::$load_leads = true;

        /* 1 - Lead Parent */
        $menu_items[$leads_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Leads', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=wp-lead'),
            'meta' => array('target' => '', 'title' => _x('Manage Forms', 'inbound-pro'))
        );

        /* 1.1 - Leads search form */
        $leads_search_text = __('Search All Leads', 'inbound-pro');
        $menu_items['inbound-leads-search'] = array(
            'parent' => $leads_key,
            'title' => '<form id="inbound-menu-form" method="get" action="' . admin_url('edit.php?post_type=wp-lead') . '" class=" " target="_blank">
            <input id="search-inbound-menu" type="text" placeholder="' . $leads_search_text . '" onblur="this.value=(this.value==\'\') ? \'' . $leads_search_text . '\' : this.value;" onfocus="this.value=(this.value==\'' . $leads_search_text . '\') ? \'\' : this.value;" value="' . $leads_search_text . '" name="s" value="' . esc_attr('Search Leads', 'inbound-pro') . '" class="text inbound-search-input" />
            <input type="hidden" name="post_type" value="wp-lead" />
            <input type="hidden" name="post_status" value="all" />
            ' . self::$go_button,
            'href' => false,
            'meta' => array('target' => '', 'title' => _x('Search Leads', 'Translators: For the tooltip', 'inbound-pro'))
        );

        /* 1.2 - View All Leads */
        $menu_items['inbound-leads-view'] = array(
            'parent' => $leads_key,
            'title' => __('View All Leads', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=wp-lead'),
            'meta' => array('target' => '', 'title' => __('View All Forms', 'inbound-pro'))
        );

        /* 1.3 - View Lead Lists */
        $menu_items['inbound-leads-list'] = array(
            'parent' => $leads_key,
            'title' => __('View Lead Lists', 'inbound-pro'),
            'href' => admin_url('edit-tags.php?taxonomy=wplead_list_category&post_type=wp-lead'),
            'meta' => array('target' => '', 'title' => __('View Lead Lists', 'inbound-pro'))
        );

        /* 1.4 - Create New Lead */
        $menu_items['inbound-leads-add'] = array(
            'parent' => $leads_key,
            'title' => __('Create New Lead', 'inbound-pro'),
            'href' => admin_url('post-new.php?post_type=wp-lead'),
            'meta' => array('target' => '', 'title' => __('Add new lead', 'inbound-pro'))
        );

        return $menu_items;
    }

    /**
     *  Loads Calls To Action Menu Items
     */
    public static function load_callstoaction($menu_items) {

        /* Check if Calls To Action Active */
        if (!function_exists('cta_check_active')) {
            return $menu_items;
        }

        $cta_key = 'inbound-cta';
        self::$load_forms = true;
        self::$load_callstoaction = true;

        /* 1 - Calls to Action */
        $menu_items[$cta_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Call to Actions', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=wp-call-to-action'),
            'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
        );

        /* 1.1 - View Calls to Action */
        $menu_items['inbound-cta-view'] = array(
            'parent' => $cta_key,
            'title' => __('View Calls to Action List', 'inbound-pro'),
            'href' => admin_url('post-new.php?post_type=wp-call-to-action'),
            'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
        );

        /* 1.2 - Add Calls to Action */
        $menu_items['inbound-cta-add'] = array(
            'parent' => $cta_key,
            'title' => __('Add New Call to Action', 'inbound-pro'),
            'href' => admin_url('post-new.php?post_type=wp-call-to-action'),
            'meta' => array('target' => '', 'title' => __('Add new call to action', 'inbound-pro'))
        );

        /* 1.3 - Calls to Action Categories */
        $menu_items['inbound-cta-categories'] = array(
            'parent' => $cta_key,
            'title' => __('Categories', 'inbound-pro'),
            'href' => admin_url('edit-tags.php?taxonomy=wp_call_to_action_category&post_type=wp-call-to-action'),
            'meta' => array('target' => '', 'title' => __('Landing Page Categories', 'inbound-pro'))
        );

        /* 1.4 - Settings */
        if (current_user_can('manage_options')) {
            $menu_items['inbound-cta-settings'] = array(
                'parent' => $cta_key,
                'title' => __('Settings', 'inbound-pro'),
                'href' => admin_url('edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings'),
                'meta' => array('target' => '', 'title' => __('Manage Call to Action Settings', 'inbound-pro'))
            );
        }

        return $menu_items;
    }

    /**
     *  Loads Landing Page Menu Items
     */
    public static function load_landingpages($menu_items) {
        /* Check if Landing Pages Active */
        if (!function_exists('lp_check_active')) {
            return $menu_items;
        }

        $landing_pages_key = 'inbound-landingpages';
        self::$load_forms = true;
        self::$load_landingpages = true;

        /* 1 - Landing Pages */
        $menu_items[$landing_pages_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Landing Pages', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=landing-page'),
            'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
        );

        /* 1.1 - View Landing Pages */
        $menu_items['inbound-landingpages-view'] = array(
            'parent' => $landing_pages_key,
            'title' => __('View Landing Pages List', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=landing-page'),
            'meta' => array('target' => '', 'title' => __('View All Landing Pages', 'inbound-pro'))
        );

        /* 1.2 - Add New Landing Pages */
        $menu_items['inbound-landingpages-add'] = array(
            'parent' => $landing_pages_key,
            'title' => __('Add New Landing Page', 'inbound-pro'),
            'href' => admin_url('post-new.php?post_type=landing-page'),
            'meta' => array('target' => '', 'title' => __('Add new Landing Page', 'inbound-pro'))
        );

        /* 1.3 - Landing Pages Categories */
        $menu_items['inbound-landingpages-categories'] = array(
            'parent' => $landing_pages_key,
            'title' => __('Categories', 'inbound-pro'),
            'href' => admin_url('edit-tags.php?taxonomy=landing_page_category&post_type=landing-page'),
            'meta' => array('target' => '', 'title' => __('Landing Page Categories', 'inbound-pro'))
        );

        /* 1.4 - Landing Pages Settings */
        if (current_user_can('manage_options')) {
            $menu_items['inbound-landingpages-settings'] = array(
                'parent' => $landing_pages_key,
                'title' => __('Settings', 'inbound-pro'),
                'href' => admin_url('edit.php?post_type=landing-page&page=lp_global_settings'),
                'meta' => array('target' => '', 'title' => __('Manage Landing Page Settings', 'inbound-pro'))
            );
        }


        return $menu_items;
    }

    /**
     *  Loads Email Menu Items
     */
    public static function load_mailer($menu_items) {
        /* Check if Landing Pages Active */
        if (!function_exists('mailer_check_active')) {
            return $menu_items;
        }

        $mailer_key = 'mailer';

        /* 1 - Inbound Mailer Component */
        $menu_items[$mailer_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Email', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=inbound-email'),
            'meta' => array('target' => '', 'title' => __('View All E-Mails', 'inbound-pro'))
        );

        /* 1.1 - View Email */
        $menu_items['mailer-view'] = array(
            'parent' => $mailer_key,
            'title' => __('View Email List', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=inbound-email'),
            'meta' => array('target' => '', 'title' => __('View All E-Mails', 'inbound-pro'))
        );

        /* 1.2 - Add New Email */
        $menu_items['mailer-create'] = array(
            'parent' => $mailer_key,
            'title' => __('Create New eMail', 'inbound-pro'),
            'href' => admin_url('post-new.php?post_type=inbound-email'),
            'meta' => array('target' => '', 'title' => __('Create New E-Mail', 'inbound-pro'))
        );

        return $menu_items;
    }

    /**
     *  Loads Automation Menu Items
     */
    public static function load_automation($menu_items) {
        /* Check if Landing Pages Active */
        if (!function_exists('inbound_automation_check_active')) {
            return $menu_items;
        }

        $automation_key = 'automation';

        /* 1 - Inbound Automation Component */
        $menu_items[$automation_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Automation', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=automation'),
            'meta' => array('target' => '', 'title' => __('View All Rules', 'inbound-pro'))
        );

        /* 1.1 - View Rules */
        $menu_items['automation-view'] = array(
            'parent' => $automation_key,
            'title' => __('View Rules', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=automation'),
            'meta' => array('target' => '', 'title' => __('View All Rules', 'inbound-pro'))
        );

        /* 1.2 - Add New Rule */
        $menu_items['automation-create'] = array(
            'parent' => $automation_key,
            'title' => __('Create New Rule', 'inbound-pro'),
            'href' => admin_url('post-new.php?post_type=automation'),
            'meta' => array('target' => '', 'title' => __('Create New Rule', 'inbound-pro'))
        );

        return $menu_items;
    }

    public static function load_forms($menu_items) {
        /* Check if Leads Active */
        if (!self::$load_forms) {
            return $menu_items;
        }

        $forms_key = 'inbound-forms';

        /* 1 - Manage Forms  */
        $menu_items[$forms_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Manage Forms', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=inbound-forms'),
            'meta' => array('target' => '', 'title' => _x('Manage Forms', 'inbound-pro'))
        );

        /* 1.1 - View All Forms */
        $menu_items['inbound-forms-view'] = array(
            'parent' => $forms_key,
            'title' => __('View All Forms', 'inbound-pro'),
            'href' => admin_url('edit.php?post_type=inbound-forms'),
            'meta' => array('target' => '', 'title' => __('View All Forms', 'inbound-pro'))
        );

        /* 1.1.x Get Forms and List */
        $forms = get_posts(array('post_type' => 'inbound-forms', 'post_status' => 'published'));
        foreach ($forms as $form) {
            $menu_items['inbound-form-' . $form->ID] = array(
                'parent' => 'inbound-forms-view',
                'title' => $form->post_title,
                'href' => admin_url('post.php?post=' . $form->ID . '&action=edit'),
                'meta' => array('target' => '_blank', 'title' => $form->post_title)
            );
        }

        /* 1.2 - Create New Form */
        $menu_items['inbound-forms-add'] = array(
            'parent' => $forms_key,
            'title' => __('Create New Form', 'inbound-pro'),
            'href' => admin_url('post-new.php?post_type=inbound-forms'),
            'meta' => array('target' => '', 'title' => __('Add new call to action', 'inbound-pro'))
        );

        return $menu_items;
    }

    public static function load_manage_templates($menu_items) {
        if (!isset(self::$load_landingpages) || !isset(self::$load_callstoaction)) {
            return $menu_items;
        }

        $templates_key = 'inbound-templates';

        /* 1 - Manage Templates */
        $menu_items[$templates_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Manage Templates', 'inbound-pro'),
            'href' => "",
            'meta' => array('target' => '', 'title' => _x('Manage Templates', 'inbound-pro'))
        );

        /* 1.1 - Get More Templates */
        $menu_items['inbound-gettemplates'] = array(
            'parent' => $templates_key,
            'title' => __('Download More Templates', 'inbound-pro'),
            'href' => "http://www.inboundnow.com/market",
            'meta' => array('target' => '', 'title' => __('Download More Templates', 'inbound-pro'))
        );

        /* 1.1 - Landing Page Templates */
        if (isset(self::$load_landingpages)) {
            $menu_items['inbound-landingpagetemplates'] = array(
                'parent' => $templates_key,
                'title' => __('Landing Page Templates', 'inbound-pro'),
                'href' => admin_url('edit.php?post_type=landing-page&page=lp_manage_templates'),
                'meta' => array('target' => '', 'title' => __('Landing Page Templates', 'inbound-pro'))
            );
        }

        /* 1.1 - Call To Action Templates */
        if (isset(self::$load_callstoaction)) {
            $menu_items['inbound-ctatemplates'] = array(
                'parent' => $templates_key,
                'title' => __('Call to Action Templates', 'inbound-pro'),
                'href' => admin_url('edit.php?post_type=wp-call-to-action&page=wp_cta_manage_templates'),
                'meta' => array('target' => '', 'title' => __('Call to Action Templates', 'inbound-pro'))
            );
        }

        return $menu_items;
    }

    public static function load_settings($menu_items) {
        $settings_key = 'inbound-settings';

        /* 1 - Global Settings */
        $menu_items[$settings_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Settings', 'inbound-pro'),
            'href' => "",
            'meta' => array('target' => '', 'title' => _x('Manage Settings', 'inbound-pro'))
        );

        /* 1.1 - Call to Action Settings */
        if (defined('INBOUND_PRO_PATH')) {
            $menu_items['inbound-now-settings'] = array(
                'parent' => $settings_key,
                'title' => __('Inbound Pro Settings', 'inbound-pro'),
                'href' => admin_url('admin.php?page=inbound-pro'),
                'meta' => array('target' => '', 'title' => __('Inbound Pro Settings', 'inbound-pro'))
            );
            $menu_items['inbound-now-extension-settings'] = array(
                'parent' => $settings_key,
                'title' => __('Extension Settings', 'inbound-pro'),
                'href' => admin_url('admin.php?tab=inbound-pro-settings&page=inbound-pro'),
                'meta' => array('target' => '', 'title' => __('Extension Settings', 'inbound-pro'))
            );
        }

        /* 1.1 - Call to Action Settings */
        if (self::$load_callstoaction) {
            $menu_items['inbound-ctasettings'] = array(
                'parent' => $settings_key,
                'title' => __('Call to Action Settings', 'inbound-pro'),
                'href' => admin_url('edit.php?post_type=wp-call-to-action&page=wp_cta_global_settings'),
                'meta' => array('target' => '', 'title' => __('Call to Action Settings', 'inbound-pro'))
            );
        }

        if (self::$load_landingpages) {
            $menu_items['inbound-landingpagesettings'] = array(
                'parent' => $settings_key,
                'title' => __('Landing Page Settings', 'inbound-pro'),
                'href' => admin_url('edit.php?post_type=landing-page&page=lp_global_settings'),
                'meta' => array('target' => '', 'title' => __('Landing Page Settings', 'inbound-pro'))
            );
        }

        if (self::$load_leads) {
            $menu_items['inbound-leadssettings'] = array(
                'parent' => $settings_key,
                'title' => __('Lead Settings', 'inbound-pro'),
                'href' => admin_url('edit.php?post_type=wp-lead&page=wpleads_global_settings'),
                'meta' => array('target' => '', 'title' => __('Lead Settings', 'inbound-pro'))
            );
        }

        return $menu_items;
    }

    public static function load_analytics($menu_items) {
        $analytics_key = 'inbound-analytics';

        /* 1 - Analytics */
        $menu_items[$analytics_key] = array(
            'parent' => self::$inboundnow_menu_key,
            'title' => __('Analytics (coming soon)', 'inbound-pro'),
            'href' => '#',
            'meta' => array('target' => '', 'title' => __('Analytics (coming soon)', 'inbound-pro'))
        );

        return $menu_items;
    }

    public static function load_seo($menu_items) {
        $seo_key = 'inbound-seo';

        if (function_exists('is_plugin_active') && is_plugin_active('wordpress-seo/wp-seo.php')) {
            $menu_items[$seo_key] = array(
                'parent' => self::$inboundnow_menu_key,
                'title' => __('SEO by Yoast', 'inbound-pro'),
                'href' => admin_url('admin.php?page=wpseo_dashboard'),
                'meta' => array('target' => '', 'title' => __('Manage SEO Settings', 'inbound-pro'))
            );
        }

        return $menu_items;
    }

    public static function load_support($secondary_menu_items) {
        $support_key = 'inbound-support';

        /* 1 - Support Form */
        $secondary_menu_items[$support_key] = array(
            'parent' => self::$inboundnow_menu_secondary_group_key,
            'title' => __('Support Forum', 'inbound-pro'),
            'href' => 'https://support.inboundnow.com/',
            'meta' => array('target' => '_blank', 'title' => __('Support Forum', 'inbound-pro'))
        );

        /* 1 - Documentation */
        $secondary_menu_items['inbound-docs'] = array(
            'parent' => self::$inboundnow_menu_secondary_group_key,
            'title' => __('Documentation', 'inbound-pro'),
            'href' => 'http://docs.inboundnow.com/',
            'meta' => array('title' => __('Documentation', 'inbound-pro'))
        );

        /* 1 - Doc Search */
        $search_docs_text = __('Search Docs', 'inbound-pro');

        $secondary_menu_items['inbound-docs-searchform'] = array(
            'parent' => self::$inboundnow_menu_secondary_group_key,
            'title' => '<form method="get" id="inbound-menu-form" action="//www.inboundnow.com/support/search/?action=bbp-search-request" class=" " target="_blank">
          <input id="search-inbound-menu" type="text" placeholder="' . $search_docs_text . '" onblur="this.value=(this.value==\'\') ? \'' . $search_docs_text . '\' : this.value;" onfocus="this.value=(this.value==\'' . $search_docs_text . '\') ? \'\' : this.value;" value="' . $search_docs_text . '" name="bbp_search" value="' . esc_attr('Search Docs', 'inbound-pro') . '" class="text inbound-search-input" />
          <input type="hidden" name="post_type[]" value="docs" />
          <input type="hidden" name="post_type[]" value="page" />' . self::$go_button,
            'href' => false,
            'meta' => array('target' => '', 'title' => _x('Search Docs', 'Translators: For the tooltip', 'inbound-pro'))
        );

        return $secondary_menu_items;
    }

    public static function load_inbound_hq($secondary_menu_items) {
        $hq_key = 'inbound-hq';

        /* 1 - Inbound Now Plugin HQ */
        $secondary_menu_items[$hq_key] = array(
            'parent' => self::$inboundnow_menu_secondary_group_key,
            'title' => __('Inbound Now Plugin HQ', 'inbound-pro'),
            'href' => 'https://www.inboundnow.com/',
            'meta' => array('title' => __('Inbound Now Plugin HQ', 'inbound-pro'))
        );

        /* 1.1 - GitHub Link */
        $secondary_menu_items['inbound-sites-dev'] = array(
            'parent' => $hq_key,
            'title' => __('GitHub Repository Developer Center', 'inbound-pro'),
            'href' => 'https://github.com/inboundnow',
            'meta' => array('title' => __('GitHub Repository Developer Center', 'inbound-pro'))
        );

        /* 1.2 - Offical Blog */
        $secondary_menu_items['inbound-sites-blog'] = array(
            'parent' => $hq_key,
            'title' => __('Official Blog', 'inbound-pro'),
            'href' => 'https://www.inboundnow.com/blog/',
            'meta' => array('title' => __('Official Blog', 'inbound-pro'))
        );

        /* 1.3 - My Account */
        $secondary_menu_items['inboundsitesaccount'] = array(
            'parent' => $hq_key,
            'title' => __('My Account', 'inbound-pro'),
            'href' => 'https://www.inboundnow.com/marketplace/account/',
            'meta' => array('title' => __('My Account', 'inbound-pro'))
        );

        /* 1.3.1 - Purchase History */
        $secondary_menu_items['inboundsitesaccount-history'] = array(
            'parent' => 'inboundsitesaccount',
            'title' => __('Purchase History', 'inbound-pro'),
            'href' => 'https://www.inboundnow.com/marketplace/account/purchase-history/',
            'meta' => array('title' => __('Purchase History', 'inbound-pro'))
        );

        return $secondary_menu_items;
    }

    /**
     *  Loads debug menu item section
     */
    public static function load_debug($secondary_menu_items) {
        $debug_key = 'inbound-debug';

        /* 1 - Debug Tools */
        $secondary_menu_items[$debug_key] = array(
            'parent' => self::$inboundnow_menu_secondary_group_key,
            'title' => __('<span style="color:#fff;font-size: 13px;margin-top: -1px;display: inline-block;">Debug Tools</span>', 'inbound-pro'),
            'href' => "#",
            'meta' => ""
        );

        /* 1.1 - 1.2 - Link Setup */
        $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

        $param = (preg_match("/\?/", $actual_link)) ? "&" : '?';
        if (preg_match("/inbound-dequeue-scripts/", $actual_link)) {
            $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
        } else {
            $actual_link = $actual_link . $param . 'inbound-dequeue-scripts';
        }

        $actual_link_two = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
        $param_two = (preg_match("/\?/", $actual_link_two)) ? "&" : '?';
        if (preg_match("/inbound_js/", $actual_link_two)) {
            $actual_link_two = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
        } else {
            $actual_link_two = $actual_link_two . $param_two . 'inbound_js';
        }

        /* 1.1 - Check for JS Errors */
        $secondary_menu_items['inbound-debug-checkjs'] = array(
            'parent' => $debug_key,
            'title' => __('Check for Javascript Errors', 'inbound-pro'),
            'href' => $actual_link_two,
            'meta' => array('title' => __('Click here to check javascript errors on this page', 'inbound-pro'))
        );

        /* 1.2 - Check for JS Errors */
        $secondary_menu_items['inbound-debug-turnoffscripts'] = array(
            'parent' => $debug_key,
            'title' => __('Remove Javascript Errors', 'inbound-pro'),
            'href' => $actual_link,
            'meta' => array('title' => __('Click here to remove broken javascript to fix issues', 'inbound-pro'))
        );

        /* 1.2 - Force Run All Database Routines */
        $secondary_menu_items['inbound-debug-force-shared-db-routines'] = array(
            'parent' => $debug_key,
            'title' => __('Force apply all shared database routines.', 'inbound-pro'),
            'href' => admin_url('index.php?force_upgrade_routines=true'),
            'meta' => array('title' => __('Click here to re-run all database upgrade routines. ', 'inbound-pro'))
        );

        return apply_filters('inbound_menu_debug', $secondary_menu_items, $debug_key);
    }

    /**
     *  Enqueues admin js and css
     */
    public static function enqueue_js_css() {
        if (!is_user_logged_in()) {
            return;
        }
        wp_enqueue_style('inbound_menu', INBOUNDNOW_SHARED_URLPATH . 'assets/css/admin/wpadminbar.css');
    }
}

add_action('init', array('Inbound_Menus_Adminbar', 'init'));
Inbound Pro Plugin - PHP Codex API documentation generated by ApiGen