@@ 331-339 (lines=9) @@ | ||
328 | * @param string $context What the value is for. Valid values are view and edit. |
|
329 | * @return int|null |
|
330 | */ |
|
331 | public function get_stock_quantity( $context = 'view' ) { |
|
332 | $value = $this->get_prop( 'stock_quantity', $context ); |
|
333 | ||
334 | // Inherit value from parent. |
|
335 | if ( 'view' === $context && 'parent' === $this->get_manage_stock() ) { |
|
336 | $value = apply_filters( $this->get_hook_prefix() . 'stock_quantity', $this->parent_data['stock_quantity'], $this ); |
|
337 | } |
|
338 | return $value; |
|
339 | } |
|
340 | ||
341 | /** |
|
342 | * Get backorders. |
|
@@ 348-356 (lines=9) @@ | ||
345 | * @since 3.0.0 |
|
346 | * @return string yes no or notify |
|
347 | */ |
|
348 | public function get_backorders( $context = 'view' ) { |
|
349 | $value = $this->get_prop( 'backorders', $context ); |
|
350 | ||
351 | // Inherit value from parent. |
|
352 | if ( 'view' === $context && 'parent' === $this->get_manage_stock() ) { |
|
353 | $value = apply_filters( $this->get_hook_prefix() . 'backorders', $this->parent_data['backorders'], $this ); |
|
354 | } |
|
355 | return $value; |
|
356 | } |
|
357 | ||
358 | /** |
|
359 | * Get main image ID. |