| @@ -32,37 +32,8 @@ | ||
| 32 | 32 | add_action( 'switch_blog', array( $this, 'switch_blog' ), 10, 2 ); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * Instantiate classes always needed | |
| 37 | - * | |
| 38 | - * @since 2.6 | |
| 39 | - */ | |
| 40 | - public function init() { | |
| 41 | - // REST API | |
| 42 | - if ( class_exists( 'PLL_REST_API' ) ) { | |
| 43 | - $this->rest_api = new PLL_REST_API( $this ); | |
| 44 | - } | |
| 45 | - | |
| 46 | - if ( $this->model->get_languages_list() ) { | |
| 47 | - // Used by content duplicate and post synchronization | |
| 48 | - if ( class_exists( 'PLL_Sync_Content' ) ) { | |
| 49 | - $this->sync_content = new PLL_Sync_Content( $this ); | |
| 50 | - } | |
| 51 | - | |
| 52 | - // Active languages | |
| 53 | - if ( class_exists( 'PLL_Active_Languages' ) ) { | |
| 54 | - $this->active_languages = new PLL_Active_Languages( $this ); | |
| 55 | - } | |
| 56 | - | |
| 57 | - // Share post slugs | |
| 58 | - if ( get_option( 'permalink_structure' ) && $this->options['force_lang'] && class_exists( 'PLL_Share_Post_Slug' ) ) { | |
| 59 | - $this->share_post_slug = new PLL_Share_Post_Slug( $this ); | |
| 60 | - } | |
| 61 | - } | |
| 62 | - } | |
| 63 | - | |
| 64 | - /** | |
| 65 | 36 | * Registers our widgets |
| 66 | 37 | * |
| 67 | 38 | * @since 0.1 |
| 68 | 39 | */ |
| @@ -138,17 +109,17 @@ | ||
| 138 | 109 | public function __call( $func, $args ) { |
| 139 | 110 | foreach ( $this as $prop => &$obj ) { |
| 140 | 111 | if ( is_object( $obj ) && method_exists( $obj, $func ) ) { |
| 141 | 112 | if ( WP_DEBUG ) { |
| 142 | - $debug = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 113 | + $debug = debug_backtrace(); | |
| 143 | 114 | $i = 1 + empty( $debug[1]['line'] ); // The file and line are in $debug[2] if the function was called using call_user_func |
| 144 | - trigger_error( // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 115 | + trigger_error( | |
| 145 | 116 | sprintf( |
| 146 | 117 | '%1$s was called incorrectly in %3$s on line %4$s: the call to $polylang->%1$s() has been deprecated in Polylang 1.2, use PLL()->%2$s->%1$s() instead.' . "\nError handler", |
| 147 | - esc_html( $func ), | |
| 148 | - esc_html( $prop ), | |
| 149 | - esc_html( $debug[ $i ]['file'] ), | |
| 150 | - absint( $debug[ $i ]['line'] ) | |
| 118 | + $func, | |
| 119 | + $prop, | |
| 120 | + $debug[ $i ]['file'], | |
| 121 | + $debug[ $i ]['line'] | |
| 151 | 122 | ) |
| 152 | 123 | ); |
| 153 | 124 | } |
| 154 | 125 | return call_user_func_array( array( $obj, $func ), $args ); |
| @@ -154,16 +125,8 @@ | ||
| 154 | 125 | return call_user_func_array( array( $obj, $func ), $args ); |
| 155 | 126 | } |
| 156 | 127 | } |
| 157 | 128 | |
| 158 | - $debug = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 159 | - trigger_error( // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 160 | - sprintf( | |
| 161 | - 'Call to undefined function PLL()->%1$s() in %2$s on line %3$s' . "\nError handler", | |
| 162 | - esc_html( $func ), | |
| 163 | - esc_html( $debug[0]['file'] ), | |
| 164 | - absint( $debug[0]['line'] ) | |
| 165 | - ), | |
| 166 | - E_USER_ERROR | |
| 167 | - ); | |
| 129 | + $debug = debug_backtrace(); | |
| 130 | + trigger_error( sprintf( 'Call to undefined function PLL()->%1$s() in %2$s on line %3$s' . "\nError handler", $func, $debug[0]['file'], $debug[0]['line'] ), E_USER_ERROR ); | |
| 168 | 131 | } |
| 169 | 132 | } |