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
# BLOCK Facebook Crawler | |
# https://endurtech.com/block-facebook-crawler-facebookexternalhit/ | |
RewriteEngine On | |
RewriteCond %{HTTP_USER_AGENT} ^facebookexternalhit/1\.1 [NC] | |
RewriteRule ^ - [F,L] | |
# BLOCK Facebook Crawler END |
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
<?php | |
// Disable Subscriber WordPress Admin Bar | |
// Disables the WordPress Admin Bar and WordPress Admin Backend access for Subscribers. | |
// https://endurtech.com/disable-subscriber-wordpress-admin-bar/ | |
add_action( 'init', 'disable_admin_bar_for_subscribers' ); | |
function disable_admin_bar_for_subscribers() | |
{ | |
if ( current_user_can( 'subscriber' ) ) |
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
rumble() { | |
youtube-dl --no-check-certificate -f mp4-480p/webm-480p/mp4-360p/mp4-720p/mp4-1080p $(curl -s "$1" | tr -d '\n'|awk -F "embedUrl" '{print $2}'|awk -F '"' '{print $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
<?php | |
// GF Auto Delete User from WP Upon Form Entry Deletion | |
// If user entry (in members form) is trashed, then deleted from trash, they are also deleted from WP Users table. | |
// https://endurtech.com/delete-associated-wp-user-when-deleting-gravity-forms-entry/ | |
add_action( 'gform_delete_entry', function ( $entry_id ) | |
{ | |
if ( ! function_exists( 'gf_user_registration' ) ) | |
{ |
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
<?php | |
// Inserting Header Script on Specific Page with WordPress | |
// https://endurtech.com/insert-script-into-wordpress-header/ | |
add_action( 'wp_head', 'custom_header_page_scripts', 2 ); | |
function custom_header_page_scripts() | |
{ | |
if( is_page( 123 ) ) //set page number to your page number | |
{ |
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
<?php | |
// Disable Commenting in WordPress | |
// https://endurtech.com/how-to-completely-disable-comments-in-wordpress/ | |
add_action( 'admin_init', function () | |
{ | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ( $pagenow === 'edit-comments.php' ) |
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
<?php | |
// Remove Protected: and Private: from Titles in WordPress | |
// https://endurtech.com/remove-protected-private-from-title-in-wordpress/ | |
add_filter( 'the_title', 'the_title_trim' ); | |
function the_title_trim( $title ) | |
{ | |
$title = attribute_escape( $title ); | |
$findthese = array( |
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
<?php | |
// Uploading to the Media Library Using Gravity Forms | |
// https://endurtech.com/upload-to-the-media-library-using-gravity-forms/ | |
add_action( 'gform_after_submission', 'iss_gf_after_submission', 10, 2 ); | |
function iss_gf_after_submission( $entry, $form ) | |
{ | |
// Walk through form fields, find file upload fields | |
foreach( $form['fields'] as $field ) |
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
<?php | |
// Inserting a Script into Start of WordPress Avada Theme Body | |
// https://endurtech.com/insert-script-into-wordpress-body/ | |
add_action( 'avada_before_body_content', 'GA4TAGMGR' ); | |
function GA4TAGMGR() | |
{ | |
echo '<!-- Google Tag Manager (noscript) --> | |
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-YOURMEASURMENTIDHERE" height="0" width="0" style="display:none;visibility:hidden;"></iframe></noscript> |
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
<?php | |
// Inserting a Script into WordPress Body | |
// https://endurtech.com/insert-script-into-wordpress-body/ | |
// wp_body_open action hook to inject a script | |
add_action( 'wp_body_open', 'custom_body_scripts', 10 ); | |
function custom_body_scripts() | |
{ | |
echo '<script>alert( "This is triggered from within the body of your website." );</script>'; |
NewerOlder