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
/** | |
* Automatically Enable Contact Form 7 Endpoints with Disable WP REST API Plugin | |
* Plugin URI: https://wordpress.org/plugins/disable-wp-rest-api/ | |
*/ | |
function disable_wp_rest_api_enable_contact_form7_endpoints() { | |
$active_plugins = get_option('active_plugins'); | |
// Check if the "Disable WP REST API" plugin is active | |
if (in_array('disable-wp-rest-api/disable-wp-rest-api.php', $active_plugins) | |
// Check if the "Contact Form 7" plugin is active | |
&& in_array('contact-form-7/wp-contact-form-7.php', $active_plugins) |
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
<main> | |
<svg class="icon"> | |
<use xlink:href="#icon"></use> | |
</svg> | |
</main> | |
<footer> | |
<!-- some content--> | |
<!-- inline svg in html --> | |
<svg xmlns="http://www.w3.org/2000/svg" style="display: 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
function add_preload_featured_image() { | |
if (is_single() || is_page()) { | |
if (has_post_thumbnail()) { | |
$post_thumbnail_id = get_post_thumbnail_id(); | |
$post_thumbnail_url = wp_get_attachment_image_url($post_thumbnail_id, 'full'); | |
if ($post_thumbnail_url) { | |
echo '<link rel="preload" href="' . esc_url($post_thumbnail_url) . '" as="image" type="image/webp">'; | |
} | |
} |
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
<?php | |
add_filter( 'pre_option_elementor_maintenance_mode_mode', function ( $option ) { | |
$parameter = 'bypass_maintenance'; // change this to whatever you like | |
if ( isset( $_GET['bypass_maintenance'] ) and $_GET['bypass_maintenance'] ) { | |
return 0; // needs to be falsy but not FALSE | |
} |
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
<?php | |
// Automatic theme updates from the GitHub repository | |
add_filter('pre_set_site_transient_update_themes', 'automatic_GitHub_updates', 100, 1); | |
function automatic_GitHub_updates($data) { | |
// Theme information | |
$theme_dtls = array( | |
'theme_parent' => get_option('template'), | |
'theme_parent_uri' => get_template_directory_uri(), | |
'theme_name' => get_option('stylesheet'), | |
'theme_template' => get_stylesheet_directory(), // Folder name of the current theme |
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
/** | |
* Author: Dakota Lee Martinez | |
* Url: https://dakotaleemartinez.com/tutorials/how-to-add-active-highlight-to-table-of-contents/ | |
* Thanks! | |
*/ | |
class Scroller { | |
static init() { | |
if (document.querySelector('.sticky-toc')) { | |
this.tocLinks = document.querySelectorAll('.sticky-toc a'); | |
this.headers = Array.from(this.tocLinks).map(link => { |
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
<?php | |
/* | |
* Custom language switcher shortcode | |
*/ | |
function trpc_language_switcher($atts) | |
{ | |
ob_start(); | |
global $TRP_LANGUAGE; |
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
function usual_tg( $message ) { | |
$token = ''; | |
$chatids = [ ]; | |
if ( stristr( $message, 'http' ) === false ) { | |
foreach ( $chatids as $chatid ) { | |
wp_remote_get( "https://api.telegram.org/bot$token/sendMessage?chat_id=$chatid&text=$message&parse_mode=HTML" ); | |
} | |
} | |
} |
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
<?php | |
class MyTheme | |
{ | |
private function actionAfterSetup($function) | |
{ | |
add_action('after_setup_theme', function() use ($function) { | |
$function(); | |
}); | |
} |
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
<!-- wp:paragraph --> | |
<p><a href="https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e">https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e</a></p> | |
<!-- /wp:paragraph --> | |
<!-- wp:heading {"className":"eplus-oOhLNH"} --> | |
<h2 class="eplus-oOhLNH">Common Blocks / Formatting / Layout Elements / Widgets and Embeds</h2> | |
<!-- /wp:heading --> | |
<!-- wp:list {"className":"eplus-eI3gin"} --> | |
<ul class="eplus-eI3gin"><li><a href="#images">Images</a> (Single image, cover image, gallery </li><li><a href="#quotes">Pull Quote / Quote</a></li><li><a href="#verse">Verse</a></li><li><a href="#buttons">Buttons</a></li><li><a href="#socialicons" data-type="internal" data-id="#socialicons">Social Icons</a></li><li><a href="#columns">Columns </a> Text (only) columns / Columns experimental</li><li><a href="#cover" data-type="internal" data-id="#cover">Cover</a> with CAT + button</li><li><a href="#paragraphs">Paragraph</a> </li><li><a href="#audio">Audio</a> </li><li><a href="#video">Video</a></li><li><a href="#w |
NewerOlder