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 | |
// add data to data layer | |
function cl_wpforms_datalayer_footer_script() { | |
?> | |
<script> | |
jQuery(document).on('wpformsAjaxSubmitSuccess', function (event, response, form) { | |
var userData = {}; | |
var $form = jQuery(jQuery('form#***')); // Ensure form ID Correct |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^ index.html [L] |
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 | |
add_filter( | |
'rest_authentication_errors', | |
function ($access) { | |
return new WP_Error( | |
'rest_disabled', | |
__("The Wordpress REST API has been disabled."), | |
array( | |
'status' => rest_authorization_required_code(), |
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 | |
function cl_itsme_disable_feed() { | |
wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) ); | |
} | |
add_action('do_feed', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_rdf', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_rss', 'cl_itsme_disable_feed', 1); | |
add_action('do_feed_rss2', 'cl_itsme_disable_feed', 1); |
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
<div class="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8"> | |
<div class="max-w-md w-full space-y-8"> | |
<div> | |
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900"> | |
Sign in to your account | |
</h2> | |
</div> | |
<form class="mt-8 space-y-6" action="" id="login-form" method="POST"> | |
<input type="hidden" name="remember" value="true"> |
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 | |
header("Content-Type: application/json; charset=UTF-8"); | |
ini_set('display_errors', 0); | |
ini_set('log_errors', 1); | |
error_reporting(E_ALL); | |
/* Vars | |
-------------------------------------- */ |
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 | |
function _classify($string) { | |
$string = preg_replace("/[^A-Za-z ]/", '', strtolower($string)); | |
return str_replace(' ', '-', $string); | |
} |
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 | |
//found somewhere. Not sure if this works. | |
add_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_safe_redirect(admin_url()); | |
exit; |
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 | |
/** | |
* Filter the except length to any specified length of words. | |
* | |
* @param string $content the content | |
* @param int $length Excerpt length. | |
* @return int (Maybe) modified excerpt length. | |
*/ |
NewerOlder