| Conditions | 1 |
| Paths | 1 |
| Total Lines | 78 |
| Code Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 32 | public function render() { |
||
| 33 | ?> |
||
| 34 | <!-- Post Meta box start--> |
||
| 35 | <fieldset class="options"> |
||
| 36 | <h4><?php _e( 'Select the post type whose post meta fields you want to delete', 'bulk-delete' ); ?></h4> |
||
| 37 | |||
| 38 | <table class="optiontable"> |
||
| 39 | <?php $this->render_post_type_dropdown(); ?> |
||
| 40 | </table> |
||
| 41 | |||
| 42 | <h4><?php _e( 'Choose your post meta field settings', 'bulk-delete' ); ?></h4> |
||
| 43 | <table class="optiontable"> |
||
| 44 | <tr> |
||
| 45 | <td> |
||
| 46 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="use_key" type="radio" checked> |
||
| 47 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on post meta key name only', 'bulk-delete' ); ?></label> |
||
| 48 | </td> |
||
| 49 | </tr> |
||
| 50 | |||
| 51 | <tr> |
||
| 52 | <td> |
||
| 53 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" id="smdb_<?php echo esc_attr( $this->field_slug ); ?>_use_key_compare" value="use_key_compare" type="radio" disabled> |
||
| 54 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on post meta key name prefix or postfix', 'bulk-delete' ); ?></label> |
||
| 55 | <span class="bd-pm-pro" style="color:red; vertical-align: middle;"> |
||
| 56 | <?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> <a href = "http://bulkwp.com/addons/bulk-delete-post-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-p" target="_blank">Buy now</a> |
||
| 57 | </span> |
||
| 58 | </td> |
||
| 59 | </tr> |
||
| 60 | |||
| 61 | <tr> |
||
| 62 | <td> |
||
| 63 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value" value="use_value" type="radio" disabled> |
||
| 64 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_use_value"><?php echo __( 'Delete based on post meta key name and value', 'bulk-delete' ); ?></label> |
||
| 65 | <span class="bd-pm-pro" style="color:red; vertical-align: middle;"> |
||
| 66 | <?php _e( 'Only available in Pro Addon', 'bulk-delete' ); ?> <a href = "http://bulkwp.com/addons/bulk-delete-post-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-m-p" target="_blank">Buy now</a> |
||
| 67 | </span> |
||
| 68 | </td> |
||
| 69 | </tr> |
||
| 70 | |||
| 71 | <tr> |
||
| 72 | <td> |
||
| 73 | <label for="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key"><?php _e( 'Post Meta Key ', 'bulk-delete' ); ?></label> |
||
| 74 | <select name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key_prefix_postfix" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key_prefix_postfix" style="display: none;"> |
||
| 75 | <option value="starts_with">starts with</option> |
||
| 76 | <option value="contains">contains</option> |
||
| 77 | <option value="ends_with">ends with</option> |
||
| 78 | </select> |
||
| 79 | <input name="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" id="smbd_<?php echo esc_attr( $this->field_slug ); ?>_key" placeholder="<?php _e( 'Meta Key', 'bulk-delete' ); ?>"> |
||
| 80 | </td> |
||
| 81 | </tr> |
||
| 82 | </table> |
||
| 83 | |||
| 84 | <?php |
||
| 85 | /** |
||
| 86 | * Add more fields to the delete post meta field form. |
||
| 87 | * This hook can be used to add more fields to the delete post meta field form. |
||
| 88 | * |
||
| 89 | * @since 5.4 |
||
| 90 | */ |
||
| 91 | do_action( 'bd_delete_post_meta_form' ); |
||
| 92 | ?> |
||
| 93 | |||
| 94 | <table class="optiontable"> |
||
| 95 | <tr> |
||
| 96 | <td colspan="2"> |
||
| 97 | <h4><?php _e( 'Choose your deletion options', 'bulk-delete' ); ?></h4> |
||
| 98 | </td> |
||
| 99 | </tr> |
||
| 100 | |||
| 101 | <?php $this->render_restrict_settings(); ?> |
||
| 102 | <?php $this->render_limit_settings(); ?> |
||
| 103 | <?php $this->render_cron_settings(); ?> |
||
| 104 | |||
| 105 | </table> |
||
| 106 | </fieldset> |
||
| 107 | |||
| 108 | <?php $this->render_submit_button(); ?> |
||
| 109 | |||
| 110 | <!-- Post Meta box end--> |
||
| 197 |