| @@ 226-234 (lines=9) @@ | ||
| 223 | case 'short_URL' : |
|
| 224 | $response[$key] = (string) esc_url_raw( wp_get_shortlink( $post->ID ) ); |
|
| 225 | break; |
|
| 226 | case 'content' : |
|
| 227 | if ( 'display' === $context ) { |
|
| 228 | add_filter( 'the_password_form', array( $this, 'the_password_form' ) ); |
|
| 229 | $response[$key] = (string) $this->get_the_post_content_for_display(); |
|
| 230 | remove_filter( 'the_password_form', array( $this, 'the_password_form' ) ); |
|
| 231 | } else { |
|
| 232 | $response[$key] = (string) $post->post_content; |
|
| 233 | } |
|
| 234 | break; |
|
| 235 | case 'excerpt' : |
|
| 236 | if ( 'display' === $context ) { |
|
| 237 | add_filter( 'the_password_form', array( $this, 'the_password_form' ) ); |
|
| @@ 210-218 (lines=9) @@ | ||
| 207 | case 'short_URL' : |
|
| 208 | $response[$key] = (string) esc_url_raw( wp_get_shortlink( $post->ID ) ); |
|
| 209 | break; |
|
| 210 | case 'content' : |
|
| 211 | if ( 'display' === $context ) { |
|
| 212 | add_filter( 'the_password_form', array( $this, 'the_password_form' ) ); |
|
| 213 | $response[$key] = (string) $this->get_the_post_content_for_display(); |
|
| 214 | remove_filter( 'the_password_form', array( $this, 'the_password_form' ) ); |
|
| 215 | } else { |
|
| 216 | $response[$key] = (string) $post->post_content; |
|
| 217 | } |
|
| 218 | break; |
|
| 219 | case 'excerpt' : |
|
| 220 | if ( 'display' === $context ) { |
|
| 221 | add_filter( 'the_password_form', array( $this, 'the_password_form' ) ); |
|