| 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 ( ! class_exists( 'WpssoSubmenuGeneral' ) && class_exists( 'WpssoAdmin' ) ) { |
| 14 |
|
| 15 |
class WpssoSubmenuGeneral extends WpssoAdmin { |
| 16 |
|
| 17 |
public function __construct( &$plugin, $id, $name, $lib, $ext ) { |
| 18 |
|
| 19 |
$this->p =& $plugin; |
| 20 |
|
| 21 |
if ( $this->p->debug->enabled ) { |
| 22 |
|
| 23 |
$this->p->debug->mark(); |
| 24 |
} |
| 25 |
|
| 26 |
$this->menu_id = $id; |
| 27 |
$this->menu_name = $name; |
| 28 |
$this->menu_lib = $lib; |
| 29 |
$this->menu_ext = $ext; |
| 30 |
|
| 31 |
$this->menu_metaboxes = array( |
| 32 |
'open_graph' => _x( 'General Settings', 'metabox title', 'wpsso' ), |
| 33 |
'social_search' => _x( 'Social and Search Sites', 'metabox title', 'wpsso' ), |
| 34 |
'social_pages' => _x( 'Social Pages and Accounts', 'metabox title', 'wpsso' ), |
| 35 |
); |
| 36 |
} |
| 37 |
|
| 38 |
/* |
| 39 |
* Add metaboxes for this settings page. |
| 40 |
* |
| 41 |
* See WpssoAdmin->load_settings_page(). |
| 42 |
*/ |
| 43 |
protected function add_settings_page_metaboxes( $callback_args = array() ) { |
| 44 |
|
| 45 |
if ( $this->p->debug->enabled ) { |
| 46 |
|
| 47 |
$this->p->debug->mark(); |
| 48 |
} |
| 49 |
|
| 50 |
$this->maybe_show_language_notice(); |
| 51 |
|
| 52 |
$this->p->media->get_default_images( $size_name = 'wpsso-opengraph' ); |
| 53 |
|
| 54 |
parent::add_settings_page_metaboxes( $callback_args ); |
| 55 |
} |
| 56 |
|
| 57 |
/* |
| 58 |
* Callback method must be public for add_meta_box() hook. |
| 59 |
* |
| 60 |
* See WpssoAdmin->add_settings_page_metaboxes(). |
| 61 |
*/ |
| 62 |
public function show_metabox_open_graph( $obj, $mb ) { |
| 63 |
|
| 64 |
if ( $this->p->debug->enabled ) { |
| 65 |
|
| 66 |
$this->p->debug->mark(); |
| 67 |
} |
| 68 |
|
| 69 |
$tabs = array( |
| 70 |
'site' => _x( 'Site Information', 'metabox tab', 'wpsso' ), |
| 71 |
'loc_defs' => _x( 'Location Defaults', 'metabox tab', 'wpsso' ), |
| 72 |
'content' => _x( 'Titles / Descriptions', 'metabox tab', 'wpsso' ), |
| 73 |
'images' => _x( 'Images', 'metabox tab', 'wpsso' ), |
| 74 |
'videos' => _x( 'Videos', 'metabox tab', 'wpsso' ), |
| 75 |
); |
| 76 |
|
| 77 |
$this->show_metabox_tabbed( $obj, $mb, $tabs ); |
| 78 |
} |
| 79 |
|
| 80 |
/* |
| 81 |
* Callback method must be public for add_meta_box() hook. |
| 82 |
* |
| 83 |
* See WpssoAdmin->add_settings_page_metaboxes(). |
| 84 |
*/ |
| 85 |
public function show_metabox_social_search( $obj, $mb ) { |
| 86 |
|
| 87 |
if ( $this->p->debug->enabled ) { |
| 88 |
|
| 89 |
$this->p->debug->mark(); |
| 90 |
} |
| 91 |
|
| 92 |
$tabs = array( |
| 93 |
'facebook' => _x( 'Facebook', 'metabox tab', 'wpsso' ), |
| 94 |
'google' => _x( 'Google', 'metabox tab', 'wpsso' ), |
| 95 |
'pinterest' => _x( 'Pinterest', 'metabox tab', 'wpsso' ), |
| 96 |
'twitter' => _x( 'X (Twitter)', 'metabox tab', 'wpsso' ), |
| 97 |
'other_sites' => _x( 'Other Sites', 'metabox tab', 'wpsso' ), |
| 98 |
); |
| 99 |
|
| 100 |
$this->show_metabox_tabbed( $obj, $mb, $tabs ); |
| 101 |
} |
| 102 |
|
| 103 |
protected function get_table_rows( $page_id, $metabox_id, $tab_key = '', $args = array() ) { |
| 104 |
|
| 105 |
$table_rows = array(); |
| 106 |
$match_rows = trim( $page_id . '-' . $metabox_id . '-' . $tab_key, '-' ); |
| 107 |
|
| 108 |
switch ( $match_rows ) { |
| 109 |
|
| 110 |
case 'essential-settings': |
| 111 |
|
| 112 |
$def_site_name = get_bloginfo( 'name' ); |
| 113 |
$def_site_desc = get_bloginfo( 'description' ); |
| 114 |
|
| 115 |
$table_rows[ 'site_name' ] = '' . |
| 116 |
$this->form->get_th_html_locale( _x( 'Site Name', 'option label', 'wpsso' ), |
| 117 |
$css_class = '', $css_id = 'site_name' ) . |
| 118 |
'<td>' . $this->form->get_input_locale( 'site_name', $css_class = 'long_name', $css_id = '', |
| 119 |
$len = 0, $def_site_name ) . '</td>'; |
| 120 |
|
| 121 |
$table_rows[ 'site_desc' ] = '' . |
| 122 |
$this->form->get_th_html_locale( _x( 'Site Description', 'option label', 'wpsso' ), |
| 123 |
$css_class = '', $css_id = 'site_desc' ) . |
| 124 |
'<td>' . $this->form->get_input_locale( 'site_desc', $css_class = 'wide', $css_id = '', |
| 125 |
$len = 0, $def_site_desc ) . '</td>'; |
| 126 |
|
| 127 |
$table_rows[ 'og_def_img_id' ] = '' . |
| 128 |
$this->form->get_th_html_locale( _x( 'Default Image ID', 'option label', 'wpsso' ), |
| 129 |
$css_class = '', $css_id = 'og_def_img_id' ) . |
| 130 |
'<td>' . $this->form->get_input_image_upload_locale( 'og_def_img' ) . '</td>'; |
| 131 |
|
| 132 |
$table_rows[ 'og_def_img_url' ] = '' . |
| 133 |
$this->form->get_th_html_locale( _x( 'or Default Image URL', 'option label', 'wpsso' ), |
| 134 |
$css_class = '', $css_id = 'og_def_img_url' ) . |
| 135 |
'<td>' . $this->form->get_input_image_url_locale( 'og_def_img' ) . '</td>'; |
| 136 |
|
| 137 |
if ( ! empty( $this->p->avail[ 'p' ][ 'schema' ] ) ) { |
| 138 |
|
| 139 |
$this->add_table_rows_schema_publisher_type( $table_rows ); |
| 140 |
} |
| 141 |
|
| 142 |
break; |
| 143 |
|
| 144 |
case 'general-open_graph-site': |
| 145 |
|
| 146 |
$def_site_name = SucomUtilWP::get_site_name(); |
| 147 |
$def_site_desc = SucomUtilWP::get_site_description(); |
| 148 |
$def_home_url = SucomUtilWP::get_home_url(); // Returns the home page URL with a trailing slash. |
| 149 |
$org_types_strict = $this->p->util->get_form_cache( 'org_types_select_strict', $add_none = false ); // Use strict for Google. |
| 150 |
$place_names = $this->p->util->get_form_cache( 'place_names', $add_none = true ); |
| 151 |
|
| 152 |
$table_rows[ 'site_name' ] = '' . |
| 153 |
$this->form->get_th_html_locale( _x( 'Site Name', 'option label', 'wpsso' ), |
| 154 |
$css_class = '', $css_id = 'site_name' ) . |
| 155 |
'<td>' . $this->form->get_input_locale( 'site_name', $css_class = 'long_name', $css_id = '', |
| 156 |
$len = 0, $def_site_name ) . '</td>'; |
| 157 |
|
| 158 |
$table_rows[ 'site_name_alt' ] = '' . |
| 159 |
$this->form->get_th_html_locale( _x( 'Site Alternate Name', 'option label', 'wpsso' ), |
| 160 |
$css_class = '', $css_id = 'site_name_alt' ) . |
| 161 |
'<td>' . $this->form->get_input_locale( 'site_name_alt', $css_class = 'long_name' ) . '</td>'; |
| 162 |
|
| 163 |
$table_rows[ 'site_desc' ] = '' . |
| 164 |
$this->form->get_th_html_locale( _x( 'Site Description', 'option label', 'wpsso' ), |
| 165 |
$css_class = '', $css_id = 'site_desc' ) . |
| 166 |
'<td>' . $this->form->get_input_locale( 'site_desc', $css_class = 'wide', $css_id = '', |
| 167 |
$len = 0, $def_site_desc ) . '</td>'; |
| 168 |
|
| 169 |
$table_rows[ 'site_home_url' ] = $this->form->get_tr_hide( $in_view = 'basic', 'site_home_url' ) . |
| 170 |
$this->form->get_th_html_locale( _x( 'Site Home URL', 'option label', 'wpsso' ), |
| 171 |
$css_class = '', $css_id = 'site_home_url' ) . |
| 172 |
'<td>' . $this->form->get_input_locale( 'site_home_url', $css_class = 'wide', $css_id = '', |
| 173 |
$len = 0, $def_home_url ) . '</td>'; |
| 174 |
|
| 175 |
if ( ! empty( $this->p->avail[ 'p' ][ 'schema' ] ) ) { // Since WPSSO Core v6.23.3. |
| 176 |
|
| 177 |
$tr_on_change_organization_html = $this->form->get_tr_on_change( 'site_pub_schema_type', 'organization' ); |
| 178 |
|
| 179 |
$this->add_table_rows_schema_publisher_type( $table_rows ); |
| 180 |
|
| 181 |
$table_rows[ 'site_org_place_id' ] = $tr_on_change_organization_html . |
| 182 |
$this->form->get_th_html( _x( 'Organization Location', 'option label', 'wpsso' ), |
| 183 |
$css_class = '', $css_id = 'site_org_place_id' ) . |
| 184 |
'<td>' . $this->form->get_select( 'site_org_place_id', $place_names, |
| 185 |
$css_class = 'wide', $css_id = '', $is_assoc = true ) . '</td>'; |
| 186 |
|
| 187 |
$table_rows[ 'site_org_schema_type' ] = $tr_on_change_organization_html . |
| 188 |
$this->form->get_th_html( _x( 'Organization Schema Type', 'option label', 'wpsso' ), |
| 189 |
$css_class = '', $css_id = 'site_org_schema_type' ) . |
| 190 |
'<td>' . $this->form->get_select( 'site_org_schema_type', $org_types_strict, |
| 191 |
$css_class = 'schema_type', $css_id = '', $is_assoc = true, $is_disabled = false, |
| 192 |
$selected = false, $event_names = array( 'on_focus_load_json' ), |
| 193 |
$event_args = array( 'json_var' => 'org_types' ) ) . '</td>'; |
| 194 |
} |
| 195 |
|
| 196 |
break; |
| 197 |
|
| 198 |
case 'general-open_graph-loc_defs': |
| 199 |
|
| 200 |
$dimension_units = WpssoUtilUnits::get_dimension_units(); |
| 201 |
$fl_volume_units = WpssoUtilUnits::get_fluid_volume_units(); |
| 202 |
$weight_units = WpssoUtilUnits::get_weight_units(); |
| 203 |
|
| 204 |
$table_rows[ 'og_def_country' ] = '' . |
| 205 |
$this->form->get_th_html( _x( 'Default Country', 'option label', 'wpsso' ), |
| 206 |
$css_class = '', $css_id = 'og_def_country' ) . |
| 207 |
'<td>' . $this->form->get_select_country( 'og_def_country' ) . '</td>'; |
| 208 |
|
| 209 |
$table_rows[ 'og_def_timezone' ] = '' . |
| 210 |
$this->form->get_th_html( _x( 'Default Timezone', 'option label', 'wpsso' ), |
| 211 |
$css_class = '', $css_id = 'og_def_timezone' ) . |
| 212 |
'<td>' . $this->form->get_select_timezone( 'og_def_timezone' ) . '</td>'; |
| 213 |
|
| 214 |
$table_rows[ 'og_def_currency' ] = '' . |
| 215 |
$this->form->get_th_html( _x( 'Default Currency', 'option label', 'wpsso' ), |
| 216 |
$css_class = '', $css_id = 'og_def_currency' ) . |
| 217 |
'<td>' . $this->form->get_select( 'og_def_currency', SucomUtil::get_currencies() ) . '</td>'; |
| 218 |
|
| 219 |
$table_rows[ 'og_def_dimension_units' ] = '' . |
| 220 |
$this->form->get_th_html( _x( 'Default Dimension Units', 'option label', 'wpsso' ), |
| 221 |
$css_class = '', $css_id = 'og_def_dimension_units' ) . |
| 222 |
'<td>' . $this->form->get_select( 'og_def_dimension_units', $dimension_units, |
| 223 |
$css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ) . '</td>'; |
| 224 |
|
| 225 |
$table_rows[ 'og_def_weight_units' ] = '' . |
| 226 |
$this->form->get_th_html( _x( 'Default Weight Units', 'option label', 'wpsso' ), |
| 227 |
$css_class = '', $css_id = 'og_def_weight_units' ) . |
| 228 |
'<td>' . $this->form->get_select( 'og_def_weight_units', $weight_units, |
| 229 |
$css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ) . '</td>'; |
| 230 |
|
| 231 |
$table_rows[ 'og_def_fluid_volume_units' ] = '' . |
| 232 |
$this->form->get_th_html( _x( 'Default Fluid Volume Units', 'option label', 'wpsso' ), |
| 233 |
$css_class = '', $css_id = 'og_def_fluid_volume_units' ) . |
| 234 |
'<td>' . $this->form->get_select( 'og_def_fluid_volume_units', $fl_volume_units, |
| 235 |
$css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ) . '</td>'; |
| 236 |
|
| 237 |
break; |
| 238 |
|
| 239 |
case 'general-open_graph-content': |
| 240 |
|
| 241 |
$table_rows[ 'og_title_sep' ] = '' . |
| 242 |
$this->form->get_th_html( _x( 'Title Separator', 'option label', 'wpsso' ), |
| 243 |
$css_class = '', $css_id = 'og_title_sep' ) . |
| 244 |
'<td>' . $this->form->get_input( 'og_title_sep', 'xshort' ) . '</td>'; |
| 245 |
|
| 246 |
$table_rows[ 'og_ellipsis' ] = '' . |
| 247 |
$this->form->get_th_html( _x( 'Truncated Text Ellipsis', 'option label', 'wpsso' ), |
| 248 |
$css_class = '', $css_id = 'og_ellipsis' ) . |
| 249 |
'<td>' . $this->form->get_input( 'og_ellipsis', 'xshort' ) . '</td>'; |
| 250 |
|
| 251 |
$table_rows[ 'og_desc_hashtags' ] = '' . |
| 252 |
$this->form->get_th_html( _x( 'Description Hashtags', 'option label', 'wpsso' ), |
| 253 |
$css_class = '', $css_id = 'og_desc_hashtags' ) . |
| 254 |
'<td>' . $this->form->get_select( 'og_desc_hashtags', range( 0, $this->p->cf[ 'form' ][ 'max_hashtags' ] ), |
| 255 |
$css_class = 'short', $css_id = '', $is_assoc = true ) . ' ' . |
| 256 |
_x( 'tag names', 'option comment', 'wpsso' ) . '</td>'; |
| 257 |
|
| 258 |
break; |
| 259 |
|
| 260 |
case 'general-open_graph-images': |
| 261 |
|
| 262 |
$max_media_items = $this->p->cf[ 'form' ][ 'max_media_items' ]; |
| 263 |
|
| 264 |
$table_rows[ 'og_img_max' ] = $this->form->get_tr_hide( $in_view = 'basic', 'og_img_max' ) . |
| 265 |
$this->form->get_th_html( _x( 'Maximum Images to Include', 'option label', 'wpsso' ), |
| 266 |
$css_class = '', $css_id = 'og_img_max' ) . |
| 267 |
'<td>' . $this->form->get_select( 'og_img_max', range( 0, $max_media_items ), |
| 268 |
$css_class = 'short', $css_id = '', $is_assoc = true ) . |
| 269 |
$this->p->msgs->maybe_preview_images_first() . '</td>'; |
| 270 |
|
| 271 |
$table_rows[ 'og_def_img_id' ] = '' . |
| 272 |
$this->form->get_th_html_locale( _x( 'Default Image ID', 'option label', 'wpsso' ), |
| 273 |
$css_class = '', $css_id = 'og_def_img_id' ) . |
| 274 |
'<td>' . $this->form->get_input_image_upload( 'og_def_img' ) . '</td>'; |
| 275 |
|
| 276 |
$table_rows[ 'og_def_img_url' ] = '' . |
| 277 |
$this->form->get_th_html_locale( _x( 'or Default Image URL', 'option label', 'wpsso' ), |
| 278 |
$css_class = '', $css_id = 'og_def_img_url' ) . |
| 279 |
'<td>' . $this->form->get_input_image_url( 'og_def_img' ) . '</td>'; |
| 280 |
|
| 281 |
break; |
| 282 |
|
| 283 |
case 'general-open_graph-videos': |
| 284 |
|
| 285 |
break; |
| 286 |
|
| 287 |
case 'general-social_search-facebook': |
| 288 |
|
| 289 |
$user_contacts = $this->p->user->get_form_contact_fields(); |
| 290 |
|
| 291 |
$table_rows[ 'fb_site_verify' ] = '' . |
| 292 |
$this->form->get_th_html( _x( 'Facebook Domain Verification ID', 'option label', 'wpsso' ), |
| 293 |
$css_class = '', $css_id = 'fb_site_verify' ) . |
| 294 |
'<td>' . $this->form->get_input( 'fb_site_verify', $css_class = 'api_key' ) . '</td>'; |
| 295 |
|
| 296 |
$table_rows[ 'fb_locale' ] = '' . |
| 297 |
$this->form->get_th_html_locale( _x( 'Facebook Locale', 'option label', 'wpsso' ), |
| 298 |
$css_class = '', $css_id = 'fb_locale' ) . |
| 299 |
'<td>' . $this->form->get_select_locale( 'fb_locale', SucomUtil::get_publisher_languages( 'facebook' ) ) . '</td>'; |
| 300 |
|
| 301 |
$table_rows[ 'fb_app_id' ] = $this->form->get_tr_hide( $in_view = 'basic', 'fb_app_id' ) . |
| 302 |
$this->form->get_th_html( _x( 'Facebook Application ID', 'option label', 'wpsso' ), |
| 303 |
$css_class = '', $css_id = 'fb_app_id' ) . |
| 304 |
'<td>' . $this->form->get_input( 'fb_app_id', $css_class = 'api_key' ) . '</td>'; |
| 305 |
|
| 306 |
break; |
| 307 |
|
| 308 |
case 'general-social_search-google': |
| 309 |
|
| 310 |
$table_rows[ 'g_site_verify' ] = '' . |
| 311 |
$this->form->get_th_html( _x( 'Google Website Verification ID', 'option label', 'wpsso' ), |
| 312 |
$css_class = '', $css_id = 'g_site_verify' ) . |
| 313 |
'<td>' . $this->form->get_input( 'g_site_verify', $css_class = 'api_key' ) . '</td>'; |
| 314 |
|
| 315 |
/* |
| 316 |
* Robots settings. |
| 317 |
* |
| 318 |
* WpssoUtilRobots->is_disabled() returns true if: |
| 319 |
* |
| 320 |
* - An SEO plugin is active. |
| 321 |
* - The 'add_meta_name_robots' option is unchecked. |
| 322 |
* - The 'wpsso_robots_disabled' filter returns true. |
| 323 |
*/ |
| 324 |
$robots_disabled = $this->p->util->robots->is_disabled(); |
| 325 |
|
| 326 |
$table_rows[ 'robots_max_snippet' ] = $this->form->get_tr_hide( $in_view = 'basic', 'robots_max_snippet' ) . |
| 327 |
$this->form->get_th_html( _x( 'Robots Snippet Max. Length', 'option label', 'wpsso' ), |
| 328 |
$css_class = '', $css_id = 'robots_max_snippet' ) . |
| 329 |
'<td>' . $this->form->get_input( 'robots_max_snippet', |
| 330 |
$css_class = 'chars', $css_id = '', $len = 0, $holder = false, $robots_disabled ) . ' ' . |
| 331 |
_x( 'characters or less', 'option comment', 'wpsso' ) . ' ' . |
| 332 |
_x( '(-1 for no limit)', 'option comment', 'wpsso' ) . '</td>'; |
| 333 |
|
| 334 |
$table_rows[ 'robots_max_image_preview' ] = $this->form->get_tr_hide( $in_view = 'basic', 'robots_max_image_preview' ) . |
| 335 |
$this->form->get_th_html( _x( 'Robots Image Preview Size', 'option label', 'wpsso' ), |
| 336 |
$css_class = '', $css_id = 'robots_max_image_preview' ) . |
| 337 |
'<td>' . $this->form->get_select( 'robots_max_image_preview', $this->p->cf[ 'form' ][ 'robots_max_image_preview' ], |
| 338 |
$css_class = '', $css_id = '', $is_assoc = true, $robots_disabled ) . '</td>'; |
| 339 |
|
| 340 |
$table_rows[ 'robots_max_video_preview' ] = $this->form->get_tr_hide( $in_view = 'basic', 'robots_max_video_preview' ) . |
| 341 |
$this->form->get_th_html( _x( 'Robots Video Max. Previews', 'option label', 'wpsso' ), |
| 342 |
$css_class = 'medium', $css_id = 'robots_max_video_preview' ) . |
| 343 |
'<td>' . $this->form->get_input( 'robots_max_video_preview', |
| 344 |
$css_class = 'chars', $css_id = '', $len = 0, $holder = false, $robots_disabled ) . |
| 345 |
_x( 'seconds', 'option comment', 'wpsso' ) . ' ' . |
| 346 |
_x( '(-1 for no limit)', 'option comment', 'wpsso' ) . '</td>'; |
| 347 |
|
| 348 |
break; |
| 349 |
|
| 350 |
case 'general-social_search-pinterest': |
| 351 |
|
| 352 |
$table_rows[ 'pin_site_verify' ] = '' . |
| 353 |
$this->form->get_th_html( _x( 'Pinterest Website Verification ID', 'option label', 'wpsso' ), |
| 354 |
$css_class = '', $css_id = 'pin_site_verify' ) . |
| 355 |
'<td>' . $this->form->get_input( 'pin_site_verify', 'api_key' ) . '</td>'; |
| 356 |
|
| 357 |
$table_rows[ 'pin_add_nopin_header_img_tag' ] = $this->form->get_tr_hide( $in_view = 'basic', 'pin_add_nopin_header_img_tag' ) . |
| 358 |
$this->form->get_th_html( _x( 'Add "nopin" to Site Header Image', 'option label', 'wpsso' ), |
| 359 |
$css_class = '', $css_id = 'pin_add_nopin_header_img_tag' ) . |
| 360 |
'<td>' . $this->form->get_checkbox( 'pin_add_nopin_header_img_tag' ) .' ' . |
| 361 |
_x( '(recommended)', 'option comment', 'wpsso' ) . '</td>'; |
| 362 |
|
| 363 |
$table_rows[ 'pin_add_nopin_media_img_tag' ] = '' . |
| 364 |
$this->form->get_th_html( _x( 'Add Pinterest "nopin" to Images', 'option label', 'wpsso' ), |
| 365 |
$css_class = '', $css_id = 'pin_add_nopin_media_img_tag' ) . |
| 366 |
'<td>' . $this->form->get_checkbox( 'pin_add_nopin_media_img_tag' ) . ' ' . |
| 367 |
_x( '(recommended)', 'option comment', 'wpsso' ) . '</td>'; |
| 368 |
|
| 369 |
$table_rows[ 'pin_add_img_html' ] = '' . |
| 370 |
$this->form->get_th_html( _x( 'Add Hidden Image for Pinterest', 'option label', 'wpsso' ), |
| 371 |
$css_class = '', $css_id = 'pin_add_img_html' ) . |
| 372 |
'<td>' . $this->form->get_checkbox( 'pin_add_img_html' ) . ' ' . |
| 373 |
_x( '(recommended)', 'option comment', 'wpsso' ) . '</td>'; |
| 374 |
|
| 375 |
break; |
| 376 |
|
| 377 |
case 'general-social_search-twitter': |
| 378 |
|
| 379 |
$tc_types = array( |
| 380 |
'summary' => _x( 'Summary', 'option value', 'wpsso' ), |
| 381 |
'summary_large_image' => _x( 'Summary Large Image', 'option value', 'wpsso' ), |
| 382 |
); |
| 383 |
|
| 384 |
$table_rows[ 'tc_type_singular' ] = '' . |
| 385 |
$this->form->get_th_html( _x( 'X (Twitter) Card for Singular with Image', 'option label', 'wpsso' ), |
| 386 |
$css_class = '', $css_id = 'tc_type_singular' ) . |
| 387 |
'<td>' . $this->form->get_select( 'tc_type_singular', $tc_types ) . '</td>'; |
| 388 |
|
| 389 |
$table_rows[ 'tc_type_default' ] = '' . |
| 390 |
$this->form->get_th_html( _x( 'X (Twitter) Card Type by Default', 'option label', 'wpsso' ), |
| 391 |
$css_class = '', $css_id = 'tc_type_default' ) . |
| 392 |
'<td>' . $this->form->get_select( 'tc_type_default', $tc_types ) . '</td>'; |
| 393 |
|
| 394 |
break; |
| 395 |
|
| 396 |
case 'general-social_search-other_sites': |
| 397 |
|
| 398 |
$table_rows[ 'ahrefs_site_verify' ] = '' . |
| 399 |
$this->form->get_th_html( _x( 'Ahrefs Website Verification ID', 'option label', 'wpsso' ), |
| 400 |
$css_class = '', $css_id = 'ahrefs_site_verify' ) . |
| 401 |
'<td>' . $this->form->get_input( 'ahrefs_site_verify', 'api_key' ) . '</td>'; |
| 402 |
|
| 403 |
$table_rows[ 'baidu_site_verify' ] = '' . |
| 404 |
$this->form->get_th_html( _x( 'Baidu Website Verification ID', 'option label', 'wpsso' ), |
| 405 |
$css_class = '', $css_id = 'baidu_site_verify' ) . |
| 406 |
'<td>' . $this->form->get_input( 'baidu_site_verify', 'api_key' ) . '</td>'; |
| 407 |
|
| 408 |
$table_rows[ 'bing_site_verify' ] = '' . |
| 409 |
$this->form->get_th_html( _x( 'Bing Website Verification ID', 'option label', 'wpsso' ), |
| 410 |
$css_class = '', $css_id = 'bing_site_verify' ) . |
| 411 |
'<td>' . $this->form->get_input( 'bing_site_verify', 'api_key' ) . '</td>'; |
| 412 |
|
| 413 |
$table_rows[ 'yandex_site_verify' ] = '' . |
| 414 |
$this->form->get_th_html( _x( 'Yandex Website Verification ID', 'option label', 'wpsso' ), |
| 415 |
$css_class = '', $css_id = 'yandex_site_verify' ) . |
| 416 |
'<td>' . $this->form->get_input( 'yandex_site_verify', 'api_key' ) . '</td>'; |
| 417 |
|
| 418 |
break; |
| 419 |
|
| 420 |
case 'general-social_pages': |
| 421 |
|
| 422 |
foreach ( WpssoConfig::get_social_accounts() as $social_key => $label ) { |
| 423 |
|
| 424 |
switch ( $social_key ) { |
| 425 |
|
| 426 |
case 'fb_publisher_url': |
| 427 |
case 'instagram_publisher_url': |
| 428 |
case 'linkedin_publisher_url': |
| 429 |
case 'pin_publisher_url': |
| 430 |
case 'tiktok_publisher_url': |
| 431 |
case 'tc_site': |
| 432 |
case 'yt_publisher_url': |
| 433 |
|
| 434 |
$tr_hide = ''; |
| 435 |
|
| 436 |
break; |
| 437 |
|
| 438 |
default: |
| 439 |
|
| 440 |
$tr_hide = $this->form->get_tr_hide( $in_view = 'basic', 'social_key' ); |
| 441 |
|
| 442 |
break; |
| 443 |
} |
| 444 |
|
| 445 |
$input_class = strpos( $social_key, '_url' ) ? 'wide' : ''; |
| 446 |
|
| 447 |
$table_rows[ $social_key ] = $tr_hide . |
| 448 |
$this->form->get_th_html_locale( _x( $label, 'option value', 'wpsso' ), |
| 449 |
$css_class = 'nowrap', $social_key ) . |
| 450 |
'<td>' . $this->form->get_input_locale( $social_key, $input_class ) . '</td>'; |
| 451 |
} |
| 452 |
|
| 453 |
break; |
| 454 |
} |
| 455 |
|
| 456 |
return $table_rows; |
| 457 |
} |
| 458 |
|
| 459 |
private function add_table_rows_schema_publisher_type( array &$table_rows ) { |
| 460 |
|
| 461 |
if ( $this->p->debug->enabled ) { |
| 462 |
|
| 463 |
$this->p->debug->mark(); |
| 464 |
} |
| 465 |
|
| 466 |
$site_owners = WpssoUser::get_persons_names( $add_none = true, $roles_id = 'owner' ); |
| 467 |
|
| 468 |
$table_rows[ 'site_pub_schema_type' ] = '' . |
| 469 |
$this->form->get_th_html( _x( 'Site Publisher Type', 'option label', 'wpsso' ), $css_class = '', $css_id = 'site_pub_schema_type' ) . |
| 470 |
'<td>' . $this->form->get_select( 'site_pub_schema_type', $this->p->cf[ 'form' ][ 'publisher_types' ], |
| 471 |
$css_class = '', $css_id = '', $is_assoc = true, $is_disabled = false, |
| 472 |
$selected = false, $event_names = array( 'on_change_unhide_rows' ) ) . '</td>'; |
| 473 |
|
| 474 |
/* |
| 475 |
* Publisher Type Person. |
| 476 |
*/ |
| 477 |
$table_rows[ 'site_pub_person_id' ] = $this->form->get_tr_on_change( 'site_pub_schema_type', 'person' ) . |
| 478 |
$this->form->get_th_html( _x( 'Site Publisher Person', 'option label', 'wpsso' ), '', 'site_pub_person_id' ) . |
| 479 |
'<td>' . $this->form->get_select( 'site_pub_person_id', $site_owners, |
| 480 |
$css_class = '', $css_id = '', $is_assoc = true ) . '</td>'; |
| 481 |
|
| 482 |
/* |
| 483 |
* Publisher Type Organization. |
| 484 |
*/ |
| 485 |
$table_rows[ 'site_org_logo_url' ] = $this->form->get_tr_on_change( 'site_pub_schema_type', 'organization' ) . |
| 486 |
$this->form->get_th_html_locale( '<a href="https://developers.google.com/search/docs/advanced/structured-data/logo">' . |
| 487 |
_x( 'Organization Logo URL', 'option label', 'wpsso' ) . '</a>', $css_class = '', $css_id = 'site_org_logo_url' ) . |
| 488 |
'<td>' . $this->form->get_input_locale( 'site_org_logo_url', $css_class = 'wide' ) . '</td>'; |
| 489 |
|
| 490 |
$table_rows[ 'site_org_banner_url' ] = $this->form->get_tr_on_change( 'site_pub_schema_type', 'organization' ) . |
| 491 |
$this->form->get_th_html_locale( '<a href="https://developers.google.com/search/docs/data-types/article#logo-guidelines">' . |
| 492 |
_x( 'Organization Banner URL', 'option label', 'wpsso' ) . '</a>', $css_class = '', $css_id = 'site_org_banner_url' ) . |
| 493 |
'<td>' . $this->form->get_input_locale( 'site_org_banner_url', $css_class = 'wide' ) . '</td>'; |
| 494 |
} |
| 495 |
} |
| 496 |
} |
| 497 |
|