| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * Manages copy and synchronization of terms and post metas |
| 8 | 5 | * |
| @@ -166,9 +163,9 @@ | ||
| 166 | 163 | |
| 167 | 164 | // Sticky posts |
| 168 | 165 | if ( in_array( 'sticky_posts', $this->options['sync'] ) ) { |
| 169 | 166 | $stickies = get_option( 'sticky_posts' ); |
| 170 | - if ( isset( $_REQUEST['sticky'] ) && 'sticky' === $_REQUEST['sticky'] ) { // phpcs:ignore WordPress.Security.NonceVerification | |
| 167 | + if ( isset( $_REQUEST['sticky'] ) && 'sticky' === $_REQUEST['sticky'] ) { | |
| 171 | 168 | $stickies = array_merge( $stickies, array_values( $translations ) ); |
| 172 | 169 | } else { |
| 173 | 170 | $stickies = array_diff( $stickies, array_values( $translations ) ); |
| 174 | 171 | } |
| @@ -191,18 +188,18 @@ | ||
| 191 | 188 | $obj = substr( $func, 5 ); |
| 192 | 189 | |
| 193 | 190 | if ( is_object( $this->$obj ) && method_exists( $this->$obj, 'copy' ) ) { |
| 194 | 191 | if ( WP_DEBUG ) { |
| 195 | - $debug = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 192 | + $debug = debug_backtrace(); | |
| 196 | 193 | $i = 1 + empty( $debug[1]['line'] ); // The file and line are in $debug[2] if the function was called using call_user_func |
| 197 | 194 | |
| 198 | - trigger_error( // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 195 | + trigger_error( | |
| 199 | 196 | sprintf( |
| 200 | 197 | '%1$s was called incorrectly in %3$s on line %4$s: the call to PLL()->sync->%1$s() has been deprecated in Polylang 2.3, use PLL()->sync->%2$s->copy() instead.' . "\nError handler", |
| 201 | - esc_html( $func ), | |
| 202 | - esc_html( $obj ), | |
| 203 | - esc_html( $debug[ $i ]['file'] ), | |
| 204 | - absint( $debug[ $i ]['line'] ) | |
| 198 | + $func, | |
| 199 | + $obj, | |
| 200 | + $debug[ $i ]['file'], | |
| 201 | + $debug[ $i ]['line'] | |
| 205 | 202 | ) |
| 206 | 203 | ); |
| 207 | 204 | } |
| 208 | 205 | return call_user_func_array( array( $this->$obj, 'copy' ), $args ); |
| @@ -207,16 +204,8 @@ | ||
| 207 | 204 | } |
| 208 | 205 | return call_user_func_array( array( $this->$obj, 'copy' ), $args ); |
| 209 | 206 | } |
| 210 | 207 | |
| 211 | - $debug = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 212 | - trigger_error( // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 213 | - sprintf( | |
| 214 | - 'Call to undefined function PLL()->sync->%1$s() in %2$s on line %3$s' . "\nError handler", | |
| 215 | - esc_html( $func ), | |
| 216 | - esc_html( $debug[0]['file'] ), | |
| 217 | - absint( $debug[0]['line'] ) | |
| 218 | - ), | |
| 219 | - E_USER_ERROR | |
| 220 | - ); | |
| 208 | + $debug = debug_backtrace(); | |
| 209 | + trigger_error( sprintf( 'Call to undefined function PLL()->sync->%1$s() in %2$s on line %3$s' . "\nError handler", $func, $debug[0]['file'], $debug[0]['line'] ), E_USER_ERROR ); | |
| 221 | 210 | } |
| 222 | 211 | } |