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; |
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_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 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 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
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 | |
} |
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
/** | |
* 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; |
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
# 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 |
NewerOlder