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
javascript:(function(){ | |
style = document.createElement('style'); | |
style.classList.add('outline-everything-with-red'); | |
style.appendChild(document.createTextNode('@media screen and ( min-width: 768px ) { | |
.edit-post-visual-editor .editor-post-title, | |
.edit-post-visual-editor .editor-block-list__block { | |
max-width: 1100px; | |
} | |
} | |
.edit-post-visual-editor .editor-block-list__block[data-align="wide"] { |
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
javascript:(function(){ | |
const outline = document.querySelector('.outline-everything-with-red'); | |
if(!outline){ | |
style = document.createElement('style'); | |
style.classList.add('outline-everything-with-red'); | |
style.appendChild(document.createTextNode('* {outline: 1px solid red;}')); | |
document.head.appendChild(style); | |
console.log('The following elements appear to be wider than the document.'); |
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 | |
//Inject Events Calendar template controls in this plugin | |
add_filter('tribe_events_template', function($file, $template){ | |
$override_template = TKGEM_ROOT_DIR.'tribe-events/'.$template; | |
$theme_template = trailingslashit(get_stylesheet_directory()).'tribe-events/'.$template; | |
if(file_exists($override_template) && !file_exists($theme_template)){ | |
$file = TKGEM_ROOT_DIR.'tribe-events/single-event.php'; | |
} | |
return $file; |
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 tas_search(){ | |
ob_start(); | |
//Searches by string | |
$args = [ | |
's' => 'yop_poll', //Or whatever | |
'post_type' => 'any', | |
'posts_per_page' => -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
<?php | |
/** | |
* Combines two WP_Queries, and appends the second to the first | |
* @author: Alex Standiford | |
* @date : 6/20/2017 | |
*/ | |
class mergedQuery extends \WP_Query{ | |
public $post_ids_to_merge = []; |
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 | |
$events = new WP_Query([ | |
'post_type' => 'tribe_events', | |
'posts_per_page' => 9, | |
'order' => 'asc', | |
'orderby' => 'EventStartDate', | |
]); | |
?> |
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 //do not include this line when you copy/paste | |
function eav_override_template(){ | |
$result = ''; | |
//Starts the form | |
$result = "<div id='taseav-age-verify' class='taseav-age-verify'>"; | |
$result .= "<form class='taseav-verify-form'>"; | |
$result .= "<h2>" . get_option('eav_form_title') . "</h2>"; | |
//If the settings call to enter the age, do this |
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 | |
/** | |
* Embed helper class for all WordPress embeds | |
* User: Alex | |
* Date: 1/13/2017 | |
* Time: 1:11 PM | |
*/ | |
namespace embedHelper; |
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 | |
/** | |
* Cleans up YouTube Video Embeds | |
**/ | |
function imp_custom_youtube_querystring( $html, $url, $args ) { | |
if(strpos($html, 'youtube')!= FALSE) { | |
$args = [ | |
'rel' => 0, | |
'controls' => 0, | |
'showinfo' => 0, |
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
class option{ | |
public function __construct($ID,$title,$object,$callback = null,$page = null,$section = null,$prefix = 'your_prefix_'){ | |
$this->ID = $prefix.$ID; | |
$this->title = $title; | |
$this->callback = ($callback == null) ? array($object,$this->ID.'_callback') : array($object,$callback); | |
$this->page = ($page == null) ? 'eav-settings-admin' : $page; | |
$this->section = ($section == null) ? 'eav_options_id' : $section; | |
} | |
} |