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 / 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';
});
@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 / 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 / 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 / change-pdfviewer-slug.php
Created January 26, 2023 18:01
Change the slug of pdf viewer for wordpress from pdfviewer to anything you prefer. Put the code below in your active theme's fuctions.php file
if( ! function_exists( 'themencode_change_pdfviewer_slug' ) ):
add_filter( 'register_post_type_args', 'themencode_change_pdfviewer_slug', 10, 2 );
function themencode_change_pdfviewer_slug( $args, $post_type ) {
if ( 'pdfviewer' === $post_type ) {
$args['rewrite']['slug'] = 'pdfs'; // replace pdfs with your preferred slug
}
@abdulawal39
abdulawal39 / hide-pdf-viewer-from-wordpress-search.php
Created March 21, 2022 16:00
Exclude PDF Viewers from WordPress Search Results.
/**
* Please add this code in your active theme's functions.php file
* This will exclude PDF Viewer from WordPress Search Results
*/
add_action( 'init', 'tnc_hide_pvfw_search', 99 );
function tnc_hide_pvfw_search() {
global $wp_post_types;
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@abdulawal39
abdulawal39 / S3-CORS.json
Created December 14, 2020 12:37
s3 cors
[
{
"AllowedHeaders": [],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
@abdulawal39
abdulawal39 / pvfw-links-new-tab.php
Created September 24, 2020 15:44
force all links in pdf to open in a new tab - PDF Viewer for WordPress
@abdulawal39
abdulawal39 / hide-shadow-pvfw.css
Created July 19, 2020 07:36
Hide Page Shadow in viewer PDF Viewer for WordPress
/**
* Css code to hide shadow from pages
* in PDF Viewer for WordPress
* Put this css in Custom CSS field of PDF Viewer options page
*/
.textLayer{
box-shadow: none;
-webkit-box-shadow: none;
}