Skip to content

Commit

Permalink
Linkedin share Feature add
Browse files Browse the repository at this point in the history
  • Loading branch information
Mann47 committed Nov 28, 2024
1 parent 545af9f commit 3a4824c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ function qmnSocialShare(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id
"&" + "description=";
}
if (network === 'linkedin') {
url = "https://www.linkedin.com/sharing/share-offsite?url=" + encodeURIComponent(mlw_qmn_social_text);
url = "https://www.linkedin.com/sharing/share-offsite/?url=" + pageUrlEncoded;
}
if (network == 'twitter') {
url = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(mlw_qmn_social_text);
Expand Down
2 changes: 1 addition & 1 deletion php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function mlw_qmn_variable_social_share( $content, $mlw_quiz_array ) {
$sharing = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'linkedin_sharing_text', '%QUIZ_NAME%' );
$sharing = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $sharing, "quiz_linkedin_sharing_text-{$mlw_quiz_array['quiz_id']}" );
$sharing = apply_filters( 'mlw_qmn_template_variable_results_page', $sharing, $mlw_quiz_array );
$social_display = "<a class=\"mlw_qmn_quiz_link\" onclick=\"qmnSocialShare('linkedin', '" . esc_js( $sharing ) . "', '" . esc_js( $mlw_quiz_array['quiz_name'] ) . "', '$page_link');\"><img src='" . $ln_image . "' alt='" . __( 'Linkedin Share', 'quiz-master-next' ) . "' /></a>";
$social_display = "<a class=\"mlw_qmn_quiz_link\" onclick=\"qmnSocialShare('linkedin', '" . esc_js( $sharing ) . "', '" . esc_js( $mlw_quiz_array['quiz_name'] ) . "', '', '$page_link');\"><img src='" . $ln_image . "' alt='" . __( 'Linkedin Share', 'quiz-master-next' ) . "' /></a>";
$content = str_replace( '%LINKEDIN_SHARE%', $social_display, $content );
}
return $content;
Expand Down

0 comments on commit 3a4824c

Please sign in to comment.