This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tnc_support_modify_a_tags() { | |
?> | |
<script type="text/javascript"> | |
document.addEventListener('DOMContentLoaded', function() { | |
function tnc_support_update_links() { | |
// Find all 'a' tags with the class 'fullscreen-mode' | |
const fullscreenLinks = document.querySelectorAll('a.fullscreen-mode'); | |
// Loop through the NodeList and update the target to '_parent' | |
fullscreenLinks.forEach(function(link) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tncpvfw_support_disable_pdfviewer_archive_and_hide_from_google($args, $post_type) { | |
if ($post_type === 'pdfviewer') { | |
$args['has_archive'] = false; | |
} | |
return $args; | |
} | |
add_filter('register_post_type_args', 'tncpvfw_support_disable_pdfviewer_archive_and_hide_from_google', 10, 2); | |
function tncpvfw_support_add_noindex_meta_tag() { | |
echo '<meta name="robots" content="noindex, nofollow" />'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function allows users to click and drag anywhere to flip | |
* Specifically for TNC FlipBook: https://codecanyon.net/item/pdf-viewer-for-wordpress/8182815 | |
* Put this code in your active theme's functions.php file | |
* | |
* @return void | |
*/ | |
function tnc_pvfw_support_allow_drag_flip_anywhere() { | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bypass Autolink on TNC FlipBook | |
* This snippet allows you to apply autolink to any domains | |
* Copy and paste this code in your active theme's functions.php file | |
* Disable Automatic link/iframe in TNC FlipBook > Global Settings to avoid conflicts. | |
* | |
* @return void | |
*/ | |
function tncsupport_pdf_autolink() { | |
$get_pvfw_global_settings = get_option( 'pvfw_csf_options' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.pvfw_page_prev img, .pvfw_page_next img{ | |
transform: rotate(90deg); | |
} | |
.pvfw_page_next { | |
z-index: 100; | |
bottom: 0; | |
top: inherit; | |
left: 45%; | |
right: inherit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip -r FILE_NAME.zip FOLDER-NAME -x "*/.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* It has to be overwriten in the plugin file manually unfortunately. | |
* For some reason, the standard wp function for checking mimetype does not return proper value for the html or htm files. | |
* Thats why the following function needs to be edited to fix the issue. | |
* The file is inside includes folder named helper-functions.php | |
* Simply find the function named get_file_mime_type and replace the whole function with the following. | |
*/ | |
function get_file_mime_type( $file_path ){ | |
$mime = mime_content_type($file_path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Hide scrollbar for Chrome, Safari and Opera */ | |
#viewerContainer::-webkit-scrollbar { | |
display: none; | |
} | |
/* Hide scrollbar for IE, Edge and Firefox */ | |
#viewerContainer { | |
-ms-overflow-style: none; /* IE and Edge */ | |
scrollbar-width: none; /* Firefox */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add the following code in your active theme's functions.php file | |
*/ | |
function tnc_pvfw_disable_text_selection_script() { | |
?> | |
<script> | |
document.addEventListener('DOMContentLoaded', function () { | |
document.body.style.userSelect = 'none'; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add the following code in your active theme's functions.php file | |
*/ | |
function tnc_pvfw_set_has_archive_false( $args, $post_type ) { | |
if ( 'pdfviewer' === $post_type ) { | |
$args['has_archive'] = false; | |
} | |
return $args; |
NewerOlder