• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Abstract_Presentation::__get() – Magic getter for lazy loading of generate functions.

You appear to be a bot. Output may be restricted

Description

Magic getter for lazy loading of generate functions.

Usage

$mixed = Abstract_Presentation::__get( $name );

Parameters

$name
( string ) required – The property to get.

Returns

mixed The value if it could be generated.

Source

File name: wordpress-seo/src/presentations/abstract-presentation.php
Lines:

1 to 11 of 11
  public function __get( $name ) {
    if ( $this->is_prototype() ) {
      throw new Exception( 'Attempting property access on prototype presentation. Use Presentation::of( $data ) to get a model presentation.' );
    }
    $generator = "generate_$name";
    if ( \method_exists( $this, $generator ) ) {
      $this->{$name} = $this->$generator();
      return $this->{$name};
    }
    throw new Exception( "Property $name has no generator. Expected function $generator." );
  }
 

 View on GitHub View on Trac

Published: 2nd May 2020 | Last updated: 15th June 2020

Primary Sidebar

Information

Function name: Abstract_Presentation::__get
Class ref: Abstract_Presentation
Plugin ref: Yoast SEO
Version: 20.2.1
Sourcefile: src/presentations/abstract-presentation.php
File ref: src/presentations/abstract-presentation.php
Deprecated?: No
API Letters: A,G,P

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 6.1.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:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2023. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites