← All changes
|
compatibility/class-wpo-custom-permalink-compatibility.php
+6
-6
3.2.22
→
4.7.0
View file →
| @@ -9,11 +9,9 @@ | ||
| 9 | 9 | /** |
| 10 | 10 | * Constructor. |
| 11 | 11 | */ |
| 12 | 12 | private function __construct() { |
| 13 | - if (!class_exists('Custom_Permalinks')) return; | |
| 14 | - | |
| 15 | - add_filter('custom_permalink_before_saving', array($this, 'custom_permalink_before_saving'), 10, 1); | |
| 13 | + add_filter('custom_permalink_before_saving', array($this, 'custom_permalink_before_saving')); | |
| 16 | 14 | add_filter('pre_update_option_custom_permalink_table', array($this, 'pre_update_option_custom_permalink_table'), 10, 2); |
| 17 | 15 | add_action('update_option_permalink_structure', array($this, 'update_option_permalink_structure'), 10, 2); |
| 18 | 16 | } |
| 19 | 17 | |
| @@ -18,13 +16,15 @@ | ||
| 18 | 16 | } |
| 19 | 17 | |
| 20 | 18 | /** |
| 21 | 19 | * Returns singleton instance. |
| 20 | + * | |
| 21 | + * @return self | |
| 22 | 22 | */ |
| 23 | 23 | public static function instance() { |
| 24 | 24 | static $instance = null; |
| 25 | - if (null == $instance) { | |
| 26 | - $instance = new static; | |
| 25 | + if (null === $instance) { | |
| 26 | + $instance = new self(); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return $instance; |
| 30 | 30 | } |
| @@ -120,9 +120,9 @@ | ||
| 120 | 120 | * |
| 121 | 121 | * @return void |
| 122 | 122 | */ |
| 123 | 123 | private function update_posts_custom_permalinks() { |
| 124 | - $post_types = get_post_types(array('public' => true), 'names'); | |
| 124 | + $post_types = get_post_types(array('public' => true)); | |
| 125 | 125 | $args = array( |
| 126 | 126 | 'post_type' => $post_types, |
| 127 | 127 | 'posts_per_page' => -1, |
| 128 | 128 | ); |