Thanks. I added a validation widget to the ticket page:
https://screenshots.firefox.com/p0WdPgr35J2zKFSD/surniaulula.com
Here’s the code, in case anyone else is interested. ??
add_action( 'wpsc_before_ticket_widget', 'custom_show_validation_widget' );
function custom_show_validation_widget( $post_id ) {
global $current_user;
if ( ! $current_user->has_cap( 'wpsc_agent' ) ) { // Only show widget for agents.
return;
}
$url = get_post_meta( $post_id, 'wordpress-permalink-url', true );
if ( empty( $url ) ) { // Skip if there's no url provided.
return;
}
$url_encoded = urlencode( $url );
$buttons = array(
'facebook' => array(
'label' => __( 'Facebook Debugger', 'supportcandy' ),
'url' => 'https://developers.facebook.com/tools/debug/og/object?q=' . $url_encoded,
),
'linkedin' => array(
'label' => __( 'LinkedIn Inspector', 'supportcandy' ),
'url' => 'https://www.linkedin.com/post-inspector/inspect/' . $url_encoded,
),
'google' => array(
'label' => __( 'Google Testing Tool', 'supportcandy' ),
'url' => 'https://search.google.com/structured-data/testing-tool/u/0/#url=' . $url_encoded,
),
'pinterest' => array(
'label' => __( 'Pinterest Validator', 'supportcandy' ),
'url' => 'https://developers.pinterest.com/tools/url-debugger/?link=' . $url_encoded,
),
'twitter' => array(
'label' => __( 'Twitter Validator', 'supportcandy' ),
'url' => 'https://cards-dev.twitter.com/validator',
),
'w3c' => array(
'label' => __( 'W3C Markup Validation', 'supportcandy' ),
'url' => 'https://validator.w3.org/nu/?doc=' . $url_encoded,
),
);
$ticket_widget_name = __( 'Validation Tools', 'supportcandy' );
$wpsc_appearance_individual_ticket_page = get_option('wpsc_individual_ticket_page');
echo '<div class="row" style="';
echo 'background-color:' . $wpsc_appearance_individual_ticket_page[ 'wpsc_ticket_widgets_bg_color' ] . ' !important;';
echo 'color:' . $wpsc_appearance_individual_ticket_page[ 'wpsc_ticket_widgets_text_color' ] . ' !important;';
echo 'border-color:' . $wpsc_appearance_individual_ticket_page[ 'wpsc_ticket_widgets_border_color' ] . ' !important;';
echo '">';
echo '<h4 class="widget_header"><i class="fa fa-check-circle"></i> ' . $ticket_widget_name . '</h4>';
echo '<hr class="widget_devider">';
foreach ( $buttons as $btn ) {
echo '<button class="btn" type="button" onclick="window.open(\'' . $btn[ 'url' ] . '\', \'_blank\');" style="';
echo 'background-color:' . $wpsc_appearance_individual_ticket_page['wpsc_other_reply_form_btn_bg_color'] . ' !important;';
echo 'color:' . $wpsc_appearance_individual_ticket_page['wpsc_other_reply_form_btn_text_color'] . ' !important;';
echo 'border-color:' . $wpsc_appearance_individual_ticket_page['wpsc_other_reply_form_btn_border_color'] . ' !important;';
echo 'margin-bottom:5px;';
echo 'width:100%;';
echo '">' . $btn[ 'label' ] . '</button>';
}
echo '</div>';
}
js.