| Conditions | 1 |
| Paths | 1 |
| Total Lines | 67 |
| 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 |
||
| 136 | public function create( $params ) { |
||
| 137 | ?> |
||
| 138 | <p> |
||
| 139 | <strong><?php esc_html_e( 'Are you publishing as an individual or as a company?', 'wordlift' ); ?></strong> |
||
| 140 | </p> |
||
| 141 | |||
| 142 | <p id="wl-publisher-type"> |
||
| 143 | <span> |
||
| 144 | <input |
||
| 145 | id="wl-publisher-person" |
||
| 146 | type="radio" |
||
| 147 | name="wl_publisher[type]" |
||
| 148 | value="person" |
||
| 149 | checked="checked" |
||
| 150 | > |
||
| 151 | |||
| 152 | <label for="wl-publisher-person"> |
||
| 153 | <?php esc_html_e( 'Person', 'wordlift' ); ?> |
||
| 154 | </label> |
||
| 155 | </span> |
||
| 156 | |||
| 157 | <span> |
||
| 158 | <input |
||
| 159 | id="wl-publisher-company" |
||
| 160 | type="radio" |
||
| 161 | name="wl_publisher[type]" |
||
| 162 | value="organization" |
||
| 163 | > |
||
| 164 | |||
| 165 | <label for="wl-publisher-company"> |
||
| 166 | <?php esc_html_e( 'Company', 'wordlift' ); ?> |
||
| 167 | </label> |
||
| 168 | </span> |
||
| 169 | </p> |
||
| 170 | |||
| 171 | <p id="wl-publisher-name"> |
||
| 172 | <input |
||
| 173 | type="text" |
||
| 174 | name="wl_publisher[name]" |
||
| 175 | placeholder="<?php echo esc_attr__( "What's your name?", 'wordlift' ); ?>" |
||
| 176 | > |
||
| 177 | </p> |
||
| 178 | |||
| 179 | <div id="wl-publisher-logo"> |
||
| 180 | <input |
||
| 181 | type="hidden" |
||
| 182 | id="wl-publisher-media-uploader-id" |
||
| 183 | name="wl_publisher[thumbnail_id]" |
||
| 184 | /> |
||
| 185 | |||
| 186 | <p> |
||
| 187 | <b><?php esc_html_e( "Choose the publisher's Logo", 'wordlift' ); ?></b> |
||
| 188 | </p> |
||
| 189 | |||
| 190 | <p> |
||
| 191 | <img id="wl-publisher-media-uploader-preview"/> |
||
| 192 | |||
| 193 | <button |
||
| 194 | type="button" |
||
| 195 | class="button" |
||
| 196 | id="wl-publisher-media-uploader"> |
||
| 197 | <?php esc_html_e( 'Select an existing image or upload a new one', 'wordlift' ); ?> |
||
| 198 | </button> |
||
| 199 | </p> |
||
| 200 | </div> |
||
| 201 | <?php |
||
| 202 | } |
||
| 203 | |||
| 205 |