diff --git a/classes/admin/class.settings.php b/classes/admin/class.settings.php index 242f1d68..00b60dd3 100644 --- a/classes/admin/class.settings.php +++ b/classes/admin/class.settings.php @@ -880,8 +880,8 @@ public static function render_fields( $page ) { case false: /* WPEngine advertisement here */ echo '
-

Sponsored Moment: Inbound PRO works great on WPEngine.

- +

Sponsored Moment: Inbound PRO works great on WPEngine. Get 4 months free on annual Startup, Growth, and Scale plans when you use our coupon code WPE20OFF.

+
'; echo ' '; break; diff --git a/core/automation/classes/class.post-type.automation.php b/core/automation/classes/class.post-type.automation.php index d571ae6a..427b0a99 100644 --- a/core/automation/classes/class.post-type.automation.php +++ b/core/automation/classes/class.post-type.automation.php @@ -19,6 +19,7 @@ private function load_hooks() { /* Load Admin Only Hooks */ if (is_admin()) { + add_action( 'admin_init' , array( __CLASS__ , 'register_role_capabilities' ) ,999); /* Register Columns */ add_filter( 'manage_automation_posts_columns' , array( __CLASS__ , 'register_columns') ); @@ -50,6 +51,9 @@ private function load_hooks() { /* process bulk actions */ add_action('load-edit.php', array(__CLASS__, 'process_bulk_actions')); + + add_action('admin_notices', array( __CLASS__ , 'prompt_rebuild_database' ) ); + } } @@ -78,7 +82,7 @@ public static function register_post_type() { 'menu_icon' => '', 'show_in_menu' => true, 'show_in_nav_menus' => false, - 'capability_type' => 'post', + 'capability_type' => array('rule','rules'), 'hierarchical' => false, 'menu_position' => 35, 'supports' => array('title') @@ -88,6 +92,35 @@ public static function register_post_type() { } + /** + * Register Role Capabilities + */ + public static function register_role_capabilities() { + // Add the roles you'd like to administer the custom post types + $roles = array('inbound_marketer','administrator'); + + // Loop through each role and assign capabilities + foreach($roles as $the_role) { + + $role = get_role($the_role); + if (!$role) { + continue; + } + + $role->add_cap( 'read' ); + $role->add_cap( 'read_rules'); + $role->add_cap( 'read_private_rules' ); + $role->add_cap( 'edit_rule' ); + $role->add_cap( 'edit_rules' ); + $role->add_cap( 'edit_others_rules' ); + $role->add_cap( 'edit_published_rules' ); + $role->add_cap( 'publish_rules' ); + $role->add_cap( 'delete_others_rules' ); + $role->add_cap( 'delete_private_rules' ); + $role->add_cap( 'delete_published_rules' ); + } + } + /** * Get Automation Rules as Array * @return array @@ -198,7 +231,7 @@ public static function enqueue_admin_scripts( $hook ) { } public static function setup_menus() { - if ( !current_user_can('manage_options')) { + if ( !current_user_can('edit_rules')) { remove_menu_page( 'edit.php?post_type=automation' ); } } @@ -264,7 +297,7 @@ public static function process_bulk_actions() { return; } - if (!current_user_can('manage_options')) { + if (!current_user_can('edit_rules')) { die(); } @@ -369,6 +402,31 @@ public static function ajax_clear_rule_tasks() { echo $rule_id; exit; } + + /** + * Checks to see if email service Key is inputed. If it's not then it throws the notice + */ + public static function prompt_rebuild_database() { + global $post , $wpdb; + + + if (!isset($post)||$post->post_type!='automation'){ + return false; + } + + /* Check if database table exists exists */ + $table_name = $wpdb->prefix.'inbound_automation_queue'; + if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) { + return; + } + ?> +
+

',''); ?>

+
+ '; + echo '"; - echo "
+ echo " "; @@ -232,7 +232,7 @@ public static function display_stand_alone_settings() { self::inline_js(); self::save_stand_alone_settings(); - self::display_sidebar(); + //self::display_sidebar(); self::display_navigation(); foreach (self::$core_settings as $key => $data) { @@ -242,7 +242,7 @@ public static function display_stand_alone_settings() { } - echo '
+ echo '
'; echo ""; @@ -323,6 +323,42 @@ public static function display_stand_alone_settings() {
+
+
+ +

Sponsored Moment: Need to hire WordPress assistance? Agents at Codeable are ready to help.

+ + + +
'; + echo ' '; + break; + case 1: + echo '
+

This plugin works great on WPEngine! Use our special offer below to receive 20% off the first annual payment.

+ +
'; + echo ' '; + break; + case 2: + echo '
+

Did you know we offer an enhanced version of this free plugin? - Read more about our Inbound Now PRO plugin.

+
'; + echo ' '; + break; + case 3: + echo '
+

Thanks for using our free plugin! - Rate us 5 stars to help us grow!

+
'; + echo ' '; + break; + } + ?> + "; // Begin the field table and loop - echo ''; + echo '
'; foreach ($custom_fields as $field) { // get value of this field if it exists for this post @@ -659,4 +695,4 @@ function load_CTA_Settings() { add_action('admin_init', 'load_CTA_Settings'); -} \ No newline at end of file +} diff --git a/core/landing-pages/assets/js/admin/admin.post-new.js b/core/landing-pages/assets/js/admin/admin.post-new.js index ef4785ae..5576731b 100644 --- a/core/landing-pages/assets/js/admin/admin.post-new.js +++ b/core/landing-pages/assets/js/admin/admin.post-new.js @@ -29,7 +29,7 @@ jQuery(document).ready(function ($) { jQuery("#lp_template_change a").removeClass("button-primary").addClass("button"); // New Sidebar - jQuery("#postbox-container-1").html("

Download Inbound PRO and join Inbound Now's membership plan for access to premium templates.

Download Landing Page Templates

Need Custom Template Design?

Get Custom Template Setup
"); + //jQuery("#postbox-container-1").html("

Download Inbound PRO and join Inbound Now's membership plan for access to premium templates.

Download Landing Page Templates

Need Custom Template Design?

Get Custom Template Setup
"); jQuery('.lp_select_template').click(function(){ jQuery(".mceIframeContainer iframe#content_ifr").css("height", "100%"); diff --git a/core/landing-pages/classes/class.admin-notices.php b/core/landing-pages/classes/class.admin-notices.php index d532aec0..6e155c2f 100644 --- a/core/landing-pages/classes/class.admin-notices.php +++ b/core/landing-pages/classes/class.admin-notices.php @@ -15,7 +15,6 @@ public function __construct() { public static function add_hooks() { add_action('admin_notices', array( __CLASS__, 'dont_install_landing_page_templates_here')); - add_action('admin_notices', array( __CLASS__, 'get_more_templates_notice' ) ); add_action('admin_notices', array( __CLASS__, 'permalink_structure_notice' ) ); } @@ -77,38 +76,6 @@ public static function dont_install_landing_page_templates_here() { } } - - /** - * Call to action to download more templates - */ - public static function get_more_templates_notice() { - global $pagenow; - $page_string = isset($_GET["page"]) ? $_GET["page"] : "null"; - if ((($pagenow == 'edit.php') && ($page_string == "lp_manage_templates")) || (($pagenow == "post-new.php") && (isset($_GET['post_type']) && $_GET['post_type'] == "landing-page"))) { - - /* only show administrators */ - if( !current_user_can('activate_plugins') ) { - return; - } - - ?> - - - 'lp_global_settings_main_header', 'type' => 'header', - 'default' => __('Landing Pages Core Settings' , 'inbound-pro') , + 'default' => __('Core Settings' , 'inbound-pro') , 'options' => null ), array( @@ -262,7 +262,7 @@ public static function display_settings() { } } - + $active_tab = 'lp-main'; if (isset($_REQUEST['open-tab'])) { $active_tab = sanitize_title($_REQUEST['open-tab']); @@ -286,12 +286,8 @@ class="lp-nav-tab nav-tab nav-tab-special
"; - echo "

Like the Plugin? Leave us a review

Leave a Quick Review
Reviews help constantly improve the plugin & keep us motivated! Thank you for your support!

Help keep the plugin up to date, awesome & free!

- - - - - Spare some change? Buy us a coffee/beer. We appreciate your continued support.

Follow Updates on Facebook

"; + echo "
"; + echo ""; echo ""; @@ -308,19 +304,39 @@ class="lp-nav-tab nav-tab nav-tab-special

-
-
- - -
-
-
-
- -
-
+ +

Sponsored Moment: Need to hire WordPress assistance? Agents at Codeable are ready to help.

+ + + +
'; + echo ' '; + break; + case 1: + echo '
+

This plugin works great on WPEngine! Use our special offer below to receive 20% off the first annual payment.

+ +
'; + echo ' '; + break; + case 2: + echo '
+

Did you know we offer an enhanced version of this plugin? - Read more about our Inbound Now PRO plugin.

+
'; + echo ' '; + break; + case 3: + echo '
+

Thanks for using our free plugin! - Rate us 5 stars to help us grow!

+
'; + echo ' '; + break; + } + ?> "Company Name", "wpleads_city" => "City", "wpleads_areaCode" => "Area Code", "wpleads_country_name" => "Country Name", "wpleads_region_code" => "State Abbreviation", "wpleads_region_name" => "State Name", "wp_lead_status" => "Lead Status", "events_triggered" => "Number of Events Triggered", "lp_page_views_count" => "Page View Count"); - - $nice_names = apply_filters('wpleads_sort_by_custom_field_nice_names', $nice_names); - return $nice_names; - } /** * Listens for a change to a leads meta data and update the change timestamp @@ -540,13 +530,11 @@ public static function prepare_nice_names() { public static function record_meta_update($meta_id, $lead_id, $meta_key, $meta_value) { $ignore = array('_edit_lock', '_edit_last'); $post_type = get_post_type($lead_id); + if ($post_type != 'wp-lead' || in_array($meta_key, $ignore)) { return; } - remove_action('updated_post_meta', 'wpleads_after_post_meta_change', 10); - remove_action('added_post_meta', 'wpleads_after_post_meta_change', 10); - $timezone_format = _x('Y-m-d G:i:s', 'timezone date format'); $wordpress_date_time = date_i18n($timezone_format); diff --git a/core/leads/classes/class.settings.php b/core/leads/classes/class.settings.php index 3d980ede..126a7e25 100644 --- a/core/leads/classes/class.settings.php +++ b/core/leads/classes/class.settings.php @@ -289,10 +289,10 @@ public static function define_stand_alone_settings() { return $wpleads_global_settings; } - + /** - * Gets array of pages with ID => Label format - */ + * Gets array of pages with ID => Label format + */ public static function leads_get_pages_array() { $pages = get_pages(); @@ -334,12 +334,8 @@ public static function display_stand_alone_settings() { } echo "
"; - echo "

Like the Plugin? Leave us a review

Leave a Quick Review
Reviews help constantly improve the plugin & keep us motivated! Thank you for your support!

Help keep the plugin up to date, awesome & free!

- - - - - Spare some change? Buy us a coffee/beer. We appreciate your continued support.

Follow Updates on Facebook

"; + echo "
"; + echo ""; echo ""; echo ""; echo ""; @@ -356,7 +352,40 @@ public static function display_stand_alone_settings() { '; echo ""; - + echo '
'; + echo '
'; + $rand = rand(0,3); + switch ($rand) { + case 0: + echo '
+

Sponsored Moment: Need to hire WordPress assistance? Agents at Codeable are ready to help.

+ + + +
'; + echo '
'; + break; + case 1: + echo '
+

This plugin works great on WPEngine! Use our special offer below to receive 20% off the first annual payment.

+ +
'; + echo ' '; + break; + case 2: + echo '
+

Did you know we offer an enhanced version of this plugin? - Read more about our Inbound Now PRO plugin.

+
'; + echo ' '; + break; + case 3: + echo '
+

Thanks for using our free plugin! - Rate us 5 stars to help us grow!

+
'; + echo ' '; + break; + } + echo ''; self::render_inline_js(); } @@ -453,13 +482,18 @@ public static function render_inline_js() { global $wpleads_global_settings; ?> +