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 redirect_to_google_doc(){ | |
//a little bit of custom routing | |
$path = request_path(); | |
if($path == 'notes'): | |
$redirect_url = 'https://docs.google.com/document/d/1vNAMaEHBrmrX1uQ-hJTdkmTk4MwaspYRzK-0I3nx454/edit?usp=sharing'; | |
wp_redirect($redirect_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
function enqueue_script_helpers() { | |
/** | |
* passes variables to javascript for cookies and frontend ajax requests. | |
*/ | |
wp_localize_script( 'main-js', 'jsHelpers', | |
array( | |
'ajaxurl' => admin_url( 'admin-ajax.php' ), | |
'siteurl' => $_SERVER['SERVER_NAME'], | |
) | |
); |
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
let TightTextWrap = (({}) => { | |
class TightTextWrap { | |
constructor(node, options = {}) { | |
this.node = node; | |
this.width = this.node.offsetWidth; | |
this.parent = this.node.parentNode; | |
this.parentWidth = this.parent.offsetWidth; | |
} | |
setWrapWidth() { |
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
@font-face { | |
font-family: 'Manrope'; | |
src: url('../fonts/manrope-bold.woff2') format('woff2'), | |
url('../fonts/manrope-bold.woff') format('woff'), | |
url('../fonts/manrope-bold.otf') format('truetype'); | |
font-style: normal; | |
font-weight: 700; | |
} | |
@font-face { |
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
@font-face { | |
font-family: 'Manrope'; | |
src: url('../fonts/manrope-bold.woff2') format('woff2'), | |
url('../fonts/manrope-bold.woff') format('woff'), | |
url('../fonts/manrope-bold.otf') format('truetype'); | |
font-style: normal; | |
font-weight: 700; | |
} | |
@font-face { |
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
@font-face { | |
font-family: 'Manrope'; | |
src: url('../fonts/manrope-bold.woff2') format('woff2'), | |
url('../fonts/manrope-bold.woff') format('woff'), | |
url('../fonts/manrope-bold.otf') format('truetype'); | |
font-style: normal; | |
font-weight: 700; | |
} | |
@font-face { |
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
<script> | |
(function() { | |
var script = document.createElement('script'); | |
script.src = 'https://example.com/assets/js/add_your_custom_script_url_here.js'; | |
script.type = 'text/javascript'; | |
// Finally, inject the element to the end of <body> | |
document.body.appendChild(script); | |
})(); |
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
/* | |
Here's the PHP that is needed to run the javascript below as a tinyMCE plugin. | |
Add to functions.php, or another PHP file that you have required or included | |
<?php | |
function gist_add_tinymce_plugins($plugin_array) { | |
$plugin_array['fontawesome'] = get_stylesheet_directory_uri() .'/assets/admin-assets/customTinyMCE.js'; | |
return $plugin_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
window.location.href = document.querySelector('link[rel="shortlink"]').getAttribute('href') + '/edit'; |
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 rmk_generate_link(array $link_array, $classes){ | |
if(!empty($link_array)): | |
$url = $link_array['url'] ?: ''; | |
$title = $link_array['title'] ?: ''; | |
$target = $link_array['target'] ? : ''; | |
//makes $classes accept a string or array | |
$class_list = $classes; | |
if(is_array($classes)): |