PluginProbe
WPSSO Core – Complete Schema Markup and Meta Tags / 22.7.0
WPSSO Core – Complete Schema Markup and Meta Tags v22.7.0
22.7.0 22.6.1 22.6.0 22.5.3 22.5.2 22.5.1 22.4.0 22.3.0 22.2.1 22.2.0 22.1.3 22.1.2 22.1.1 22.1.0 22.0.0 21.13.3 21.13.2 trunk 21.13.1
wpsso / lib / messages-tooltip-meta-product.php

messages-tooltip-meta-product.php in WPSSO Core – Complete Schema Markup and Meta Tags 22.7.0, at lib/messages-tooltip-meta-product.php

111 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * License: GPLv3
4 * License URI: https://www.gnu.org/licenses/gpl.txt
5 * Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/)
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9
10 die( 'These aren\'t the droids you\'re looking for.' );
11 }
12
13 if ( ! defined( 'WPSSO_PLUGINDIR' ) ) {
14
15 die( 'Do. Or do not. There is no try.' );
16 }
17
18 if ( ! class_exists( 'WpssoMessagesTooltipMetaProduct' ) ) {
19
20 /*
21 * Instantiated by WpssoMessagesTooltipMeta->get() only when needed.
22 */
23 class WpssoMessagesTooltipMetaProduct extends WpssoMessages {
24
25 public function get( $msg_key = false, $info = array() ) {
26
27 $this->maybe_set_properties();
28
29 $text = '';
30
31 switch ( $msg_key ) {
32
33 /*
34 * Document SSO > Edit Schema tab.
35 */
36 case 'tooltip-meta-product_award': // Product Awards.
37
38 $text = __( 'Awards this product has won.', 'wpsso' ) . ' ';
39
40 $text .= sprintf( __( 'You may use the <code>%s</code> filter to modify the custom values.', 'wpsso' ), 'wpsso_og_product_awards' ) . ' ';
41
42 break;
43
44 case ( 0 === strpos( $msg_key, 'tooltip-meta-product_' ) ? true : false ):
45
46 $tp_frags = $this->get_tooltip_fragments( preg_replace( '/^tooltip-meta-/', '', $msg_key ) ); // Uses a local cache.
47
48 if ( ! empty( $tp_frags ) ) { // Just in case.
49
50 $option_link = '';
51
52 if ( ! empty( $tp_frags[ 'opt_menu_id' ] ) && ! empty( $tp_frags[ 'opt_label' ] ) ) {
53
54 $option_link = $this->p->util->get_admin_url( $tp_frags[ 'opt_menu_id' ], $tp_frags[ 'opt_label' ] );
55
56 // translators: %1$s is a lower case item name, for example 'product Google category'.
57 $text = sprintf( __( 'A custom value for the %1$s, which may be different than the %2$s option value.', 'wpsso' ), $tp_frags[ 'name' ], $option_link ) . ' ';
58
59 $text .= sprintf( __( 'Select "[None]" to exclude the %s from Schema markup and meta tags.', 'wpsso' ), $tp_frags[ 'name' ] ) . ' ';
60
61 } else {
62
63 // translators: %s is a singular item reference, for example 'a product size group'.
64 $text = sprintf( __( 'A custom value for the %s can be provided for the main product.', 'wpsso' ), $tp_frags[ 'name' ] ) . ' ';
65
66 $text .= __( 'If product variations are available, the information from each variation may supersede this value in Schema product offers.', 'wpsso' ) . ' ';
67
68 // translators: %s is the option label.
69 $text .= sprintf( __( 'The <strong>%s</strong> option may be read-only if a custom field or e-commerce plugin is the authoritative source for this value.', 'wpsso' ), $tp_frags[ 'label' ] ) . ' ';
70
71 $text .= __( 'In this case, you should update the product information in the custom field or e-commerce plugin to update this value.', 'wpsso' ) . ' ';
72 }
73
74 if ( ! empty( $tp_frags[ 'about' ] ) ) {
75
76 // translators: %1$s is a webpage URL and %2$s is a singular item reference, for example 'a product size'.
77 $text .= sprintf( __( '<a href="%1$s">See this webpage for more information about choosing %2$s value</a>.', 'wpsso' ), $tp_frags[ 'about' ], $tp_frags[ 'desc' ] ) . ' ';
78 }
79
80 if ( ! empty( $tp_frags[ 'inherit' ] ) ) {
81
82 $text .= sprintf( __( 'Note that the %s value is automatically inherited as a default value by any child pages (like WooCommerce product variations, for example).', 'wpsso' ), $tp_frags[ 'name' ] ) . ' ';
83 }
84
85 if ( ! empty( $tp_frags[ 'import_cf' ] ) && ! empty( $tp_frags[ 'filter' ] ) ) {
86
87 $text .= sprintf( __( 'You may use the <code>%1$s</code> and/or <code>%2$s</code> filters to modify the default and custom values respectively.', 'wpsso' ), $tp_frags[ 'import_cf' ], $tp_frags[ 'filter' ] ) . ' ';
88
89 } elseif ( ! empty( $tp_frags[ 'import_cf' ] ) ) {
90
91 $text .= sprintf( __( 'You may use the <code>%s</code> filter to modify the default values.', 'wpsso' ), $tp_frags[ 'import_cf' ] ) . ' ';
92 } elseif ( ! empty( $tp_frags[ 'filter' ] ) ) {
93
94 $text .= sprintf( __( 'You may use the <code>%s</code> filter to modify the custom values.', 'wpsso' ), $tp_frags[ 'filter' ] ) . ' ';
95 }
96 }
97
98 break;
99
100 default:
101
102 $text = apply_filters( 'wpsso_messages_tooltip_meta_product', $text, $msg_key, $info );
103
104 break;
105 }
106
107 return $text;
108 }
109 }
110 }
111