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
<ul class="draggable" > | |
<li> | |
<td class="rule-info rule-op"> | |
<span class="gripicon"><i class="fas fa-grip-vertical"></i></span> | |
<span class="ruleNum"> 2</span> | |
</td> | |
<td> | |
Other |
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
// Unset user API endpoints to prevent user enumeration | |
add_filter('rest_endpoints', function($endpoints) { | |
unset( $endpoints['/wp/v2/users'] ); | |
unset( $endpoints ['/wp/v2/users/(?P<id>[\d]+)']); | |
unset( $endpoints ['[/wp/v2/users/me]']); | |
unset( $endpoints ['[/wp/v2/users/(?P<user_id>(?:[\d]+|me))/application-passwords]']); | |
unset( $endpoints ['[/wp/v2/users/(?P<user_id>(?:[\d]+|me))/application-passwords/introspect]']); | |
unset( $endpoints ['[/wp/v2/users/(?P<user_id>(?:[\d]+|me))/application-passwords/(?P<uuid>[\w\-]+)']); |
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
/* baseline sizes for use on screen width > 1699, want it fixed here */ | |
// or you can use css clamp -- | |
// https://www.smashingmagazine.com/2022/01/modern-fluid-typography-css-clamp/ */ | |
// https://developer.mozilla.org/en-US/docs/Web/CSS/clamp | |
.sidebar .top { | |
margin-bottom: 22px; | |
font-size: 16px; | |
line-height: 24px; | |
} | |
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
function arrayToTable(data) { | |
const keys = [...data.reduce((all, obj)=>{ | |
Object.keys(obj).forEach(key => all.add(key)); | |
return all; | |
}, new Set())]; | |
const header = keys.map(key => `<th>${key}</th>`).join('') | |
const tbody = data.map(row => keys.map(key => `<td>${row[key]}</td>`).join('')).map(row => `<tr>${row}</tr>`) | |
return `<table> |
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
var clickIframe = window.setInterval(checkFocus, 100); | |
var i = 0; | |
function checkFocus() { | |
if(document.activeElement == document.getElementById("ifr")) { | |
console.log("clicked "+(i++)); | |
window.focus(); | |
} | |
} |
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
.container { | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); | |
grid-gap: 1rem; | |
} |
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 | |
set_time_limit(0); | |
/* works with GET or POST, one key pair only :-( | |
curl -d '{"path":"/set","query":{"color":"green"}}' -X POST http://localhost:4000 | |
curl -d '{"path":"/get","query":{"key":"color"}}' -X POST http://localhost:4000 | |
localhost:4000/set?color=green | |
localhost:4000/get?key=color |
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
fetch("https://domain.com/wp-json/wp/v2/published_rest_accessible_post_type/"+ ID) | |
.then(response => response.json()) | |
.then(data => document.getElementById("<?php echo $a['dest'];?>").innerHTML= data.content.rendered ); | |
} |
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
//Jack Johannson at https://wordpress.stackexchange.com/questions/306609/how-can-i-fetch-css-from-json-wp-rest-api-response | |
// syntax for use: http://example.com/wp-json/alexi/v1/output_css_uri | |
// Register a new rest route and create callback to execute | |
add_action( 'rest_api_init', 'my_rest_routes' ); | |
function my_rest_routes() { | |
register_rest_route( | |
'alexi/v1', |
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 | |
include ('./simple_html_dom.php'); | |
include ('./wp-load.php'); | |
function custom_wpkses_allow_iframe_here( $tags, $context ) { | |
if ( 'post' === $context ) { | |
$tags['iframe'] = array( | |
'src' => true, | |
'height' => true, |
NewerOlder