Skip to content

Instantly share code, notes, and snippets.

View abdulawal39's full-sized avatar
🎯
Focusing

Abdul Awal Uzzal abdulawal39

🎯
Focusing
View GitHub Profile
@abdulawal39
abdulawal39 / custom-redirects.php
Created December 3, 2025 13:04
Custom redirection php code for WFAM
/**
* 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
@abdulawal39
abdulawal39 / hide-mid-shadow.css
Created October 2, 2025 06:53
custom css to hide shadow in the middle of 2 page spread mode in TNC FlipBook - PDF viewer for WordPress. simply put this in TNC FlipBook > Global Settings > Custom CSS
.textLayer{
box-shadow: none!important;
-webkit-box-shadow: none!important;
-moz-box-shadow: none!important;
}
@abdulawal39
abdulawal39 / change-taxonomy-order.php
Last active February 20, 2025 14:22
Change the order of pdf cat taxonomy to DESC instead of ASC
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' );
@abdulawal39
abdulawal39 / gist:da5d19c4be8fc7e19218459bb947c684
Created December 5, 2024 12:12
Replace Categories text - Display - TNC FlipBook Addon
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);
@abdulawal39
abdulawal39 / change-fullscreen-link-target.php
Created October 24, 2024 12:23
Change fullscreen mode link target for TNC FlipBook - PDF viewer for WordPress
@abdulawal39
abdulawal39 / tnc-flipbook-disable-archive-hide-from-google.php
Created September 26, 2024 09:04
Use this code in your active theme's functions.php file.
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" />';
@abdulawal39
abdulawal39 / custom-css-to-not-allowed.php
Created February 16, 2023 06:47
Add custom css to not allowed area of PDF Viewer for WordPress
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>';
}
@abdulawal39
abdulawal39 / deregister-jquery-on-single-post-type-worpress.php
Created May 16, 2023 21:03
Add this code in your active theme's functions.php file to disable default jquery on pdfviewer pages.
add_action( 'wp_enqueue_scripts', 'themencode_control_jquery' );
function themencode_control_jquery(){
if( is_singular() && get_post_type()=='pdfviewer' ){
wp_deregister_script('jquery');
}
}
@abdulawal39
abdulawal39 / disable-pdfviewer-archive.php
Created September 13, 2023 10:20
Disable archive page for pdfviewer post type on TNC FlipBook - PDF Viewer for WordPress Plugin
/**
* 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;
@abdulawal39
abdulawal39 / disable-text-selection.php
Created November 13, 2023 11:19
Disable Text Selection on TNC FlipBook - PDF viewer for WordPress Plugin
/**
* 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';
});