This file contains hidden or 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
| /** | |
| * Custom Redirects for WFAM | |
| */ | |
| $request_uri = $_SERVER['REQUEST_URI']; | |
| $request_path = strtok($request_uri, '?'); | |
| // Match: /wp-content/uploads/anything.extension | |
| if (preg_match('#^/wp-content/uploads(/.*\.\w+)$#', $request_path, $matches)) { | |
| // Set the query parameter |
This file contains hidden or 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
| .textLayer{ | |
| box-shadow: none!important; | |
| -webkit-box-shadow: none!important; | |
| -moz-box-shadow: none!important; | |
| } |
This file contains hidden or 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 tncsupport_pre_get_terms_order( $query ) { | |
| if ( is_admin() && ! wp_doing_ajax() ) { | |
| return; | |
| } | |
| if ( isset( $query->query_vars['orderby'] ) && $query->query_vars['orderby'] === 'name' ) { | |
| $query->query_vars['order'] = 'DESC'; | |
| } | |
| } | |
| add_action( 'pre_get_terms', 'tncsupport_pre_get_terms_order' ); |
This file contains hidden or 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 tncsupport_change_categories_label($translated_text, $text, $domain) { | |
| if ($text === 'Categories' && $domain === 'display-pdf-viewer-for-wordpress-addon') { | |
| return 'Custom Text'; // Replace this with the desired text. | |
| } | |
| return $translated_text; | |
| } | |
| add_filter('gettext', 'tncsupport_change_categories_label', 10, 3); |
This file contains hidden or 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 hidden or 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 hidden or 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_action('tnc_pvfw_not_allowed_head', 'themencode_add_custom_css_for_not_allowed'); | |
| function themencode_add_custom_css_for_not_allowed(){ | |
| echo '<style type="text/css">.pvfw-not-allowed { background-color: white !important; padding: 30px !important;}</style>'; | |
| } |
This file contains hidden or 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_action( 'wp_enqueue_scripts', 'themencode_control_jquery' ); | |
| function themencode_control_jquery(){ | |
| if( is_singular() && get_post_type()=='pdfviewer' ){ | |
| wp_deregister_script('jquery'); | |
| } | |
| } |
This file contains hidden or 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; |
This file contains hidden or 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'; | |
| }); |
NewerOlder