| 1 |
<?php |
| 2 |
|
| 3 |
class LitCommerce_PermalinkSettings implements LitCommerce_Automation |
| 4 |
{ |
| 5 |
public function getName() |
| 6 |
{ |
| 7 |
return __('Make sure proper permalink structure settings', 'litcommerce'); |
| 8 |
} |
| 9 |
|
| 10 |
public function runStep() |
| 11 |
{ |
| 12 |
$currentStructure = get_option('permalink_structure'); |
| 13 |
|
| 14 |
if (!empty($currentStructure)) { |
| 15 |
return new LitCommerce_Result_Object(true); |
| 16 |
} |
| 17 |
|
| 18 |
global $wp_rewrite; |
| 19 |
$wp_rewrite->set_permalink_structure('/%postname%/'); |
| 20 |
|
| 21 |
return new LitCommerce_Result_Object(true); |
| 22 |
} |
| 23 |
} |
| 24 |
|