From 42a2fe61f0aa198e9bc6cd545f2dbeb8999fa306 Mon Sep 17 00:00:00 2001 From: ruben- Date: Sun, 30 Nov 2014 18:16:04 +0100 Subject: [PATCH] --- class/MainWPChild.class.php | 13 ++++--------- class/MainWPHelper.class.php | 6 +++++- mainwp-child.php | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/class/MainWPChild.class.php b/class/MainWPChild.class.php index 7329d84..247383c 100644 --- a/class/MainWPChild.class.php +++ b/class/MainWPChild.class.php @@ -271,24 +271,19 @@ class MainWPChild $child_menu_icon = ""; } else { $child_menu_name = "MainWP Child"; - $child_menu_icon = plugins_url('images/mainwpicon.png', dirname(plugin_basename(__FILE__))); + $child_menu_icon = 'data:image/png+xml;base64,' . base64_encode(file_get_contents($this->plugin_dir . '/images/mainwpicon.png')); } - add_menu_page($child_menu_name, $child_menu_name, 'read', 'mainwp_child_tab', array($this, 'on_show_page'), $child_menu_icon, '80.00001'); + add_menu_page($child_menu_name, $child_menu_name, 'read', 'mainwp_child_tab', false, $child_menu_icon, '80.00001'); if (!get_option('mainwp_branding_remove_setting') || $cancelled_branding) { -// add_options_page('MainWPSettings', __($this->branding . ' Settings','mainwp-child'), 'manage_options', 'MainWPSettings', array(&$this, 'settings')); -// add_options_page('MainWPSettings', __($this->branding . ' Server Information','mainwp-child'), 'manage_options', 'MainWPChildServerInformation', array('MainWPChildServerInformation', 'renderPage')); add_submenu_page('mainwp_child_tab', 'MainWPSettings', __($this->branding . ' Settings','mainwp-child') , 'manage_options', 'mainwp_child_tab', array(&$this, 'settings')); add_submenu_page('mainwp_child_tab', 'MainWPSettings', __($this->branding . ' Server Information','mainwp-child') , 'manage_options', 'MainWPChildServerInformation', array('MainWPChildServerInformation', 'renderPage')); } - if (!get_option('mainwp_branding_remove_restore') || $cancelled_branding) { -// $restorePage = add_submenu_page('import.php', $this->branding . ' Restore', $this->branding . ' Restore', 'read', 'mainwp-child-restore', array('MainWPClone', 'renderRestore')); -// $restorePage = add_submenu_page('mainwp_child_tab', $this->branding . ' Restore', $this->branding . ' Restore' , 'read', 'mainwp-child-restore', array('MainWPClone', 'renderRestore')); -// add_action('admin_print_scripts-'.$restorePage, array('MainWPClone', 'print_scripts')); - + if (!get_option('mainwp_branding_remove_restore') || $cancelled_branding) + { $sitesToClone = get_option('mainwp_child_clone_sites'); if ($sitesToClone != '0') { diff --git a/class/MainWPHelper.class.php b/class/MainWPHelper.class.php index 82559e5..9a95771 100644 --- a/class/MainWPHelper.class.php +++ b/class/MainWPHelper.class.php @@ -205,7 +205,9 @@ class MainWPHelper //Save the post to the wp remove_filter('content_save_pre', 'wp_filter_post_kses'); // to fix brake scripts or html - $new_post_id = wp_insert_post($new_post, $wp_error); + $post_status = $new_post['post_status']; + $new_post['post_status'] = 'auto-draft'; + $new_post_id = wp_insert_post($new_post, $wp_error); //Show errors if something went wrong if (is_wp_error($wp_error)) @@ -217,6 +219,8 @@ class MainWPHelper return 'Undefined error'; } + wp_update_post( array('ID' => $new_post_id, 'post_status' => $post_status)); + if (!empty($terms)) { wp_set_object_terms($new_post_id, array_map( intval, $terms), 'category'); } diff --git a/mainwp-child.php b/mainwp-child.php index 5aefa3b..76e950e 100644 --- a/mainwp-child.php +++ b/mainwp-child.php @@ -5,7 +5,7 @@ Description: Child Plugin for MainWP. The plugin is used so the installed blog can be securely managed remotely by your network. Plugin documentation and options can be found here http://docs.mainwp.com Author: MainWP Author URI: http://mainwp.com - Version: 1.4-beta6 + Version: 1.4-rc1 */ header('X-Frame-Options: ALLOWALL'); //header('X-Frame-Options: GOFORIT');