$product_object = get_post( $product->get_id() ); $title = Paper::get_from_options( 'pt_product_title', $product_object, '%title% %sep% %sitename%' ); return $title ? $title : $product->get_name(); } /** * Get post parts. */ private function get_parts() { $parts = [ 'title' => $this->get_post_title(), 'url' => $this->get_post_url(), 'canonical' => Paper::get()->get_canonical(), 'modified' => mysql2date( DATE_W3C, $this->post->post_modified, false ), 'published' => mysql2date( DATE_W3C, $this->post->post_date, false ), 'excerpt' => Helper::replace_vars( '%excerpt%', $this->post ), ]; // Description. $desc = Helper::get_post_meta( 'snippet_desc' ); if ( ! $desc ) { $desc = Helper::replace_vars( Helper::get_settings( "titles.pt_{$this->post->post_type}_default_snippet_desc" ), $this->post ); } $parts['desc'] = $desc ? $desc : ( Helper::get_post_meta( 'description' ) ? Helper::get_post_meta( 'description' ) : $parts['excerpt'] ); // Author. $author = Helper::get_post_meta( 'snippet_author' ); $parts['author'] = $author ? $author : get_the_author_meta( 'display_name', $this->post->post_author ); // Modified date cannot be before publish date. if ( strtotime( $this->post->post_modified ) < strtotime( $this->post->post_date ) ) { $parts['modified'] = $parts['published']; } $this->parts = $parts; } /** * Get global social profile URLs, to use in the `sameAs` property. * * @link https://developers.google.com/webmasters/structured-data/customize/social-profiles */ public function get_social_profiles() { $profiles = [ Helper::get_settings( 'titles.social_url_facebook' ) ]; $twitter = Helper::get_settings( 'titles.twitter_author_names' ); if ( $twitter ) { $profiles[] = "https://twitter.com/$twitter"; } $addional_profiles = Helper::get_settings( 'titles.social_additional_profiles' ); if ( ! empty( $addional_profiles ) ) { $profiles = array_merge( $profiles, Arr::from_string( $addional_profiles, "\n" ) ); } return array_values( array_filter( $profiles ) ); } } WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.