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
// prefill user first & last names on funding application "Volunteer Name" field | |
add_filter( 'gform_field_value_PREFIX_fn', 'mrw_user_first_name' ); | |
add_filter( 'gform_field_value_PREFIX_ln', 'mrw_user_last_name' ); | |
function mrw_user_first_name( $value ) { | |
$user = get_user_by( 'id', get_current_user_id() ); | |
if( !is_wp_error( $user ) ) { | |
$value = $user->user_firstname; | |
} | |
return $value; | |
} |
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 | |
// Hide Email from Spam Bots using a short code | |
// Place this in your functions.php file | |
// | |
// See: codex.wordpress.org/Function_Reference/antispambot | |
// | |
// Ex: [email]you@example.org[/email] | |
function mrw_hide_email( $atts , $content = null ) { | |
if ( ! is_email( $content ) ) { |
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
<p> | |
• First bullet<br> | |
• Second bullet. This one is really long and probably wraps and you’ll see why that’s important in a moment, but I just have to make sure that this line is really extra long to ensure that it wraps. There. I think that’s enough. Hopefully. Now. Stopping here for real this time.<br> | |
• Third bullet | |
</p> |
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
<ul> | |
<li>First bullet</li> | |
<li>Second bullet. This one is really long and probably wraps and you’ll see why that’s important in a moment, but I just have to make sure that this line is really extra long to ensure that it wraps. There. I think that’s enough. Hopefully. Now. Stopping here for real this time.</li> | |
<li>Third bullet</li> | |
</ul> |
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
<div class="wrap"> | |
<div class="content-sidebar-wrap"> | |
<main class="content facetwp-template" role="main" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog"> | |
<div class="archive-description cpt-archive-description"> | |
<h1 class="archive-title">Resource Library</h1> | |
</div> | |
<article class="post-398 hai_resources type-hai_resources status-publish has-post-thumbnail entry" itemscope="itemscope" itemtype="http://schema.org/CreativeWork"> | |
<a href="http://localhost/hai/resources/resource-1/" title="Resource #1"><img width="150" height="182" src="http://localhost/hai/wp-content/uploads/2014/10/Unknown1-150x182.jpeg" class="alignright post-image entry-image" alt="Unknown" itemprop="image" /></a> | |
<header class="entry-header"> | |
<h1 class="entry-title" itemprop="headline"><a href="http://localhost/hai/resources/resource-1/" rel="bookmark">Resource #1</a></h1> |
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 | |
add_filter( 'facetwp_pre_filtered_post_ids', 'my_facetwp_pre_filtered_post_ids', 10, 2 ); | |
function my_facetwp_pre_filtered_post_ids( $post_ids, $class ) { | |
var_dump($post_ids,$class,'hello world'); | |
} | |
add_filter( 'facetwp_facet_html', 'my_facetwp_facet_html', 10, 2 ); | |
function my_facetwp_facet_html( $output, $params ) { | |
var_dump($output,$params); | |
} |
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 | |
/* For query modification */ | |
add_action( 'pre_get_posts', 'hai_resources_pre_get_posts' ); | |
function hai_resources_pre_get_posts( $query ) { | |
// stop immediately if we're in the admin or not working with the main query | |
if( ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) || !$query->is_main_query() ) { | |
return; | |
} |
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
{"facets":[{"label":"Categories","name":"categories","type":"checkboxes","source":"tax\/category","parent_term":"","orderby":"count","operator":"and","hierarchical":"no","ghosts":"no","preserve_ghosts":"no","count":"10"},{"label":"Countries","name":"countries","type":"checkboxes","source":"tax\/hai_countries","parent_term":"","orderby":"display_value","operator":"or","hierarchical":"no","ghosts":"yes","preserve_ghosts":"yes","count":"100"},{"label":"Topic Areas","name":"topic_areas","type":"checkboxes","source":"tax\/hai_topics","parent_term":"","orderby":"display_value","operator":"or","hierarchical":"no","ghosts":"yes","preserve_ghosts":"yes","count":"100"},{"label":"Library Search","name":"library_search","type":"search","search_engine":"library_search","placeholder":""}]} |
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
<strong>Bold</strong> | |
<em>Italic</em> | |
<h2>Heading</h2> | |
<a href="#">Link</a> | |
<span style="text-decoration: underline;">Underline</span> |