| @@ -30,13 +30,8 @@ | ||
| 30 | 30 | * @var bool |
| 31 | 31 | */ |
| 32 | 32 | public $enabled = false; |
| 33 | 33 | |
| 34 | - /** | |
| 35 | - * @var WP_Post | |
| 36 | - */ | |
| 37 | - private $post; | |
| 38 | - | |
| 39 | 34 | /** |
| 40 | 35 | * @param WP_Post|int $post |
| 41 | 36 | */ |
| 42 | 37 | public function __construct( $post ) { |
| @@ -45,11 +40,8 @@ | ||
| 45 | 40 | if( ! $post instanceof WP_Post ) { |
| 46 | 41 | $post = get_post( $post ); |
| 47 | 42 | } |
| 48 | 43 | |
| 49 | - // store ref to post | |
| 50 | - $this->post = $post; | |
| 51 | - | |
| 52 | 44 | // store ID in property for quick access |
| 53 | 45 | $this->ID = $post->ID; |
| 54 | 46 | |
| 55 | 47 | // store title in property |
| @@ -194,22 +186,16 @@ | ||
| 194 | 186 | |
| 195 | 187 | return $minimum_screen_size; |
| 196 | 188 | } |
| 197 | 189 | |
| 198 | - /** | |
| 199 | - * Get options object for JS script. | |
| 200 | - * | |
| 201 | - * @return array | |
| 202 | - */ | |
| 203 | 190 | public function get_client_options() { |
| 204 | 191 | $box = $this; |
| 205 | 192 | |
| 206 | 193 | $trigger = false; |
| 207 | 194 | if( $box->options['trigger'] ) { |
| 208 | - $trigger = array( | |
| 209 | - 'method' => $this->options['trigger'] | |
| 210 | - ); | |
| 211 | 195 | |
| 196 | + $trigger = array( 'method' => $this->options['trigger'] ); | |
| 197 | + | |
| 212 | 198 | if( isset( $this->options[ 'trigger_' . $this->options['trigger'] ] ) ) { |
| 213 | 199 | $trigger['value'] = $this->options[ 'trigger_' . $this->options['trigger'] ]; |
| 214 | 200 | } |
| 215 | 201 | } |
| @@ -228,13 +214,8 @@ | ||
| 228 | 214 | 'rehide' => (bool) $box->options['auto_hide'], |
| 229 | 215 | 'position' => $box->options['css']['position'], |
| 230 | 216 | 'minimumScreenWidth' => $box->get_minimum_screen_size(), |
| 231 | 217 | 'closable' => $box->options['closable'], |
| 232 | - 'post' => array( | |
| 233 | - 'id' => $this->post->ID, | |
| 234 | - 'title' => $this->post->post_title, | |
| 235 | - 'slug' => $this->post->post_name, | |
| 236 | - ), | |
| 237 | 218 | ); |
| 238 | 219 | |
| 239 | 220 | /** |
| 240 | 221 | * Filter the final options for the JS Boxzilla client. |