• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WooCommerce a2z

WooCommerce a2z

WooCommerce

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WC_Data::get_prop() – Gets a prop for a getter method.

You appear to be a bot. Output may be restricted

Description

Gets a prop for a getter method.

Gets the value from either current pending changes, or the data itself. Context controls what happens to the value before it's returned.

Usage

$mixed = WC_Data::get_prop( $prop, $context );

Parameters

$prop
( string ) required – Name of prop to get.
$context
( string ) optional default: view – What the value is for. Valid values are view and edit.

Returns

mixed

Source

File name: woocommerce/includes/abstracts/abstract-wc-data.php
Lines:

1 to 13 of 13
  protected function get_prop( $prop, $context = 'view' ) {
    $value = null;

    if ( array_key_exists( $prop, $this->data ) ) {
      $value = array_key_exists( $prop, $this->changes ) ? $this->changes[ $prop ] : $this->data[ $prop ];

      if ( 'view' === $context ) {
        $value = apply_filters( $this->get_hook_prefix() . $prop, $value, $this );
      }
    }

    return $value;
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 26th November 2019

Primary Sidebar

Information

Function name: WC_Data::get_prop
Class ref: WC_Data
Plugin ref: WooCommerce
Version: 3.8.0
Sourcefile: includes/abstracts/abstract-wc-data.php
File ref: includes/abstracts/abstract-wc-data.php
Deprecated?: No
API Letters: D,G,P,W

Footer

WooCommerce a2z WooCommerce a2z
WooCommerce
WordPress 5.3.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2019. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites