WP Total Hacks - Version 1.0.1

Version Description

  • Allow you to remove attachment page.
  • Allow you to create child page for "Draft".
Download this release

Release Info

Developer miyauchi
Plugin Icon wp plugin WP Total Hacks
Version 1.0.1
Comparing to
See all releases

Code changes from version 0.9.1 to 1.0.1

img/remove_attachment_link.png ADDED
Binary file
img/wpbooster.png ADDED
Binary file
includes/form/post.php CHANGED
@@ -83,5 +83,22 @@
83
  </div>
84
  </div>
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  </div><!--end .tab-->
87
 
83
  </div>
84
  </div>
85
 
86
+ <div class="block">
87
+ <h4><img src="<?php echo $this->get_plugin_url(); ?>/img/check.png" height="24" width="24" /><?php _e('Remove attachment link from media uploader.', 'wp-total-hacks'); ?></h4>
88
+ <div class="block_content">
89
+ <p><?php _e('Allows you to remove link for attachment page from media uploader.', 'wp-total-hacks'); ?></p>
90
+ <p><img class="caption" alt="" src="<?php echo $this->get_plugin_url(); ?>/img/remove_attachment_link.png" style="max-width:80%;height:auto;"></p>
91
+ <?php $this->sel('wfb_attachmentlink'); ?>
92
+ </div>
93
+ </div>
94
+
95
+ <div class="block">
96
+ <h4><img src="<?php echo $this->get_plugin_url(); ?>/img/check.png" height="24" width="24" /><?php _e('Allow you to create chid page for "draft".', 'wp-total-hacks'); ?></h4>
97
+ <div class="block_content">
98
+ <p><?php _e('You can create child page for non-publish Page.', 'wp-total-hacks'); ?></p>
99
+ <?php $this->sel('wfb_createpagefordraft'); ?>
100
+ </div>
101
+ </div>
102
+
103
  </div><!--end .tab-->
104
 
includes/form/sidebar.php CHANGED
@@ -9,6 +9,11 @@
9
  </ul>
10
  </div>
11
 
 
 
 
 
 
12
  <div class="bside">
13
  <h3><?php _e('This Plugin needs your support', 'wp-total-hacks'); ?></h3>
14
  <p><?php _e('Please help support the continued development.', 'wp-total-hacks'); ?></p>
9
  </ul>
10
  </div>
11
 
12
+ <div class="bside">
13
+ <h3><?php _e('Make WordPress Site Load Faster', 'wp-total-hacks'); ?></h3>
14
+ <div style="text-align:center;"><a href="<?php _e('http://wpbooster.net/', 'wp-total-hacks'); ?>"><img src="<?php echo $this->get_plugin_url(); ?>/img/wpbooster.png"></a></div>
15
+ </div>
16
+
17
  <div class="bside">
18
  <h3><?php _e('This Plugin needs your support', 'wp-total-hacks'); ?></h3>
19
  <p><?php _e('Please help support the continued development.', 'wp-total-hacks'); ?></p>
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: miyauchi
3
  Donate link: http://wpist.me/
4
  Tags: head, post, page, functions.php, admin, logo, auto save, revision, meta box, dashboard
5
- Requires at least: 3.2
6
- Tested up to: 3.3
7
- Stable tag: 0.9.1
8
 
9
  WP Total Hacks can customize more than 20 settings on your WordPress Site.
10
  PHP5 is required!
@@ -40,7 +40,7 @@ PHP5 is required!
40
  = Support =
41
 
42
  * English - http://wpist.me/wp/wp-total-hacks/
43
- * Japanese - http://firegoby.theta.ne.jp/wp/wp-total-hacks
44
 
45
  = Translators =
46
 
@@ -88,6 +88,10 @@ Please contact to me.
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  = 0.9.1 =
92
  * Brazilian Portuguese support.
93
 
2
  Contributors: miyauchi
3
  Donate link: http://wpist.me/
4
  Tags: head, post, page, functions.php, admin, logo, auto save, revision, meta box, dashboard
5
+ Requires at least: 3.4
6
+ Tested up to: 3.4
7
+ Stable tag: 1.0.1
8
 
9
  WP Total Hacks can customize more than 20 settings on your WordPress Site.
10
  PHP5 is required!
40
  = Support =
41
 
42
  * English - http://wpist.me/wp/wp-total-hacks/
43
+ * Japanese - http://firegoby.jp/wp/wp-total-hacks
44
 
45
  = Translators =
46
 
88
 
89
  == Changelog ==
90
 
91
+ = 1.0.1 =
92
+ * Allow you to remove attachment page.
93
+ * Allow you to create child page for "Draft".
94
+
95
  = 0.9.1 =
96
  * Brazilian Portuguese support.
97
 
wp-total-hacks.php CHANGED
@@ -5,7 +5,7 @@ Author: Takayuki Miyauchi
5
  Plugin URI: http://wpist.me/wp/wp-total-hacks/
6
  Description: WP Total Hacks can customize your WordPress.
7
  Author: Takayuki Miyauchi
8
- Version: 0.9.1
9
  Author URI: http://wpist.me/
10
  Domain Path: /languages
11
  Text Domain: wp-total-hacks
@@ -49,6 +49,8 @@ private $option_params = array(
49
  'wfb_contact_methods' => 'array',
50
  'wfb_remove_excerpt' => 'bool',
51
  'wfb_update_notification' => 'bool',
 
 
52
  );
53
 
54
  public function __construct()
@@ -84,6 +86,52 @@ public function __construct()
84
  add_filter('plugin_row_meta', array(&$this, 'plugin_row_meta'), 10, 2);
85
  add_filter('user_contactmethods', array(&$this, 'user_contactmethods'));
86
  add_filter('excerpt_more', array(&$this, 'excerpt_more'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
 
89
  public function plugins_loaded()
5
  Plugin URI: http://wpist.me/wp/wp-total-hacks/
6
  Description: WP Total Hacks can customize your WordPress.
7
  Author: Takayuki Miyauchi
8
+ Version: 1.0.1
9
  Author URI: http://wpist.me/
10
  Domain Path: /languages
11
  Text Domain: wp-total-hacks
49
  'wfb_contact_methods' => 'array',
50
  'wfb_remove_excerpt' => 'bool',
51
  'wfb_update_notification' => 'bool',
52
+ 'wfb_attachmentlink' => 'bool',
53
+ 'wfb_createpagefordraft' => 'bool',
54
  );
55
 
56
  public function __construct()
86
  add_filter('plugin_row_meta', array(&$this, 'plugin_row_meta'), 10, 2);
87
  add_filter('user_contactmethods', array(&$this, 'user_contactmethods'));
88
  add_filter('excerpt_more', array(&$this, 'excerpt_more'));
89
+ add_action('admin_print_styles', array(&$this, 'admin_print_styles'));
90
+ add_filter('page_attributes_dropdown_pages_args', array(&$this, 'page_attributes_dropdown_pages_args'));
91
+ add_action('save_post', array(&$this, 'save_post'));
92
+ }
93
+
94
+ public function save_post($id)
95
+ {
96
+ if ($this->op('wfb_createpagefordraft')) {
97
+ $p = get_post($id);
98
+ if ($p->post_type === 'page' && $p->post_status !== 'trash' && isset($p->post_parent)) {
99
+ $parent_id = $p->post_parent;
100
+ if ($parent_id) {
101
+ $parent = get_post($parent_id);
102
+ $status = array('draft', 'pending', 'future');
103
+ if (isset($parent->post_status) && in_array($parent->post_status, $status)) {
104
+ remove_action('save_post', array(&$this, 'save_post'));
105
+ $args = array(
106
+ 'ID' => $id,
107
+ 'post_status' => $parent->post_status,
108
+ );
109
+ if ($parent->post_status === 'future') {
110
+ $args['post_date'] = $parent->post_date;
111
+ $args['post_date_gmt'] = $parent->post_date_gmt;
112
+ }
113
+ wp_update_post($args);
114
+ add_action('save_post', array(&$this, 'save_post'));
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+
121
+ public function page_attributes_dropdown_pages_args($args)
122
+ {
123
+ if ($this->op('wfb_createpagefordraft')) {
124
+ $args['post_status'] = 'publish,private,draft,pending,future';
125
+ return $args;
126
+ }
127
+ return $args;
128
+ }
129
+
130
+ public function admin_print_styles()
131
+ {
132
+ if ($this->op('wfb_attachmentlink')) {
133
+ echo '<style type="text/css">button.urlpost{display:none;}</style>';
134
+ }
135
  }
136
 
137
  public function plugins_loaded()