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( blocks, element ) { | |
var el = element.createElement; | |
function Stars( { stars } ) { | |
return el( 'div', { key: 'stars' }, | |
'★'.repeat( stars ), | |
( ( stars * 2 ) % 2 ) ? '½' : '' ); | |
} | |
blocks.registerBlockType( 'stars/stars-block', { |
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 | |
/** | |
* Automatically login a single WordPress user upon arrival to a specific page. | |
* | |
* Redirect to home page once logged in and prevent viewing of the login page. | |
* Compatible with WordPress 3.9.1+ | |
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead." | |
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1. | |
* |
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(window, document, version, callback) { | |
var j, d; | |
var loaded = false; | |
if (!(j = window.jQuery) || version > j.fn.jquery || callback(j, loaded)) { | |
var script = document.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = "/media/jquery.js"; | |
script.onload = script.onreadystatechange = function() { | |
if (!loaded && (!(d = this.readyState) || d == "loaded" || d == "complete")) { | |
callback((j = window.jQuery).noConflict(1), loaded = true); |
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
<html> | |
<head> | |
<title>Sample Widget Page</title> | |
</head> | |
<body> | |
<h1>Sample Widget Page</h1> | |
<script type="text/javascript" src="http://localhost:81/widget-bootstrap.js"></script> | |
<div id="widget-container"></div> |
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 () { | |
var scriptName = "embed.js"; //name of this script, used to get reference to own tag | |
var jQuery; //noconflict reference to jquery | |
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; | |
var jqueryVersion = "1.8.3"; | |
var scriptTag; //reference to the html script tag | |
/******** Get reference to self (scriptTag) *********/ | |
var allScripts = document.getElementsByTagName('script'); |