| Conditions | 4 |
| Paths | 8 |
| Total Lines | 58 |
| 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 |
||
| 30 | if ( jetpack_check_mobile() ) { |
||
| 31 | return dirname( __FILE__ ) . '/minileven/theme'; |
||
| 32 | } |
||
| 33 | |||
| 34 | return $theme_root; |
||
| 35 | } |
||
| 36 | |||
| 37 | add_filter( 'theme_root', 'minileven_theme_root' ); |
||
| 38 | |||
| 39 | function minileven_theme_root_uri( $theme_root_uri ) { |
||
| 40 | if ( jetpack_check_mobile() ) { |
||
| 41 | return plugins_url( 'modules/minileven/theme', dirname( __FILE__ ) ); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $theme_root_uri; |
||
| 45 | } |
||
| 46 | |||
| 47 | add_filter( 'theme_root_uri', 'minileven_theme_root_uri' ); |
||
| 48 | |||
| 49 | function minileven_enabled( $wp_mobile_disable_option ) { |
||
| 50 | return true; |
||
| 51 | } |
||
| 52 | |||
| 53 | if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { |
||
| 54 | add_filter( 'option_wp_mobile_disable', 'minileven_enabled' ); |
||
| 55 | } |
||
| 56 | |||
| 57 | jetpack_load_minileven(); |
||
| 58 |