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
let images = document.querySelectorAll( '.field_id-18 a' ); images.forEach( function( el ) { let url = el.getAttribute( 'href' ); let img = el.querySelector( 'img' ); img.setAttribute( 'src', url ); } ); |
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
/** | |
* Embed a Wowza streaming player in WordPress. Maps the `$` function to `jQuery.noConflict()` before running embed so that variable is available. | |
* Usage: [wowza url="//player.video.wowza.com/hosted/WOWZA_ID/wowza.js"] | |
* | |
* @param array $atts Shortcode attributes. | |
* @param string $content Container content. Not used. | |
* | |
* @return string | |
*/ | |
function embed_wowza( $atts, $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
<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
<?php | |
$rand = '_' . mt_rand( 10000, 99999 ); | |
?> | |
<label for="search<?php echo $rand; ?>"><?php echo _x( 'Search for:', 'label', 'textdomain' ); ?></label> | |
<input id="search<?php echo $rand; ?>" type="search" class="search-field" value="<?php echo get_search_query(); ?>" name="s" /> | |
<button type="submit" class="search-submit"><?php echo _x( 'Search', 'submit button', 'textdomain' ); ?></button> | |
</form> |
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
<table class="form-table" role="presentation"> | |
<tr> | |
<th scope="row"><label for="blogname">Site Title</label></th> | |
<td><input name="blogname" type="text" id="blogname" value="Make WordPress Accessible" class="regular-text" /></td> | |
</tr> | |
<tr> | |
<th scope="row"><label for="blogdescription">Tagline</label></th> | |
<td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="Equal Access For All" class="regular-text" /> |
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
<table class="wp-list-table widefat fixed striped table-view-excerpt pages"> | |
<thead> | |
<tr> | |
<td id='cb' class='manage-column column-cb check-column'><label class="screen-reader-text" for="cb-select-all-1">Select All</label><input id="cb-select-all-1" type="checkbox" /></td><th scope="col" id='title' class='manage-column column-title column-primary sortable desc'><a href="https://make.wordpress.org/accessibility/wp-admin/edit.php?post_type=handbook&orderby=title&order=asc"><span>Title</span><span class="sorting-indicator"></span></a></th><th scope="col" id='author' class='manage-column column-author'>Author</th><th scope="col" id='date' class='manage-column column-date sortable asc'><a href="https://make.wordpress.org/accessibility/wp-admin/edit.php?post_type=handbook&orderby=date&order=desc"><span>Date</span><span class="sorting-indicator"></span></a></th> | |
</tr> | |
</thead> | |
<tbody id="the-list"> | |
... | |
</tbody> |
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
add_action( 'mc_save_event', 'my_event_post', 10, 3 ); | |
function my_event_post( $action, $data, $new_event ) { | |
// if the event save was successful. | |
if ( $action == 'add' ) { | |
$title = $data['event_title']; | |
$content = "[my_calendar_event event='$new_event' template='details' list='']"; | |
$post_status = 'publish'; | |
$auth = $data['event_author']; | |
$type = 'post'; | |
$my_post = array( |
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
/* | |
* Generate the HTML links using URLs. | |
* | |
* @param integer $post_ID of current post | |
* | |
* @return string block of HTML links. | |
*/ | |
function id24_create_links( $post_ID ) { | |
$urls = id24_create_urls( $post_ID ); | |
$html = ''; |
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
/* | |
* Register custom stylesheet for ID24 social sharing. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'id24_register_styles' ); | |
function id24_register_styles() { | |
wp_register_style( 'id24-icomoon', plugins_url( 'fonts/icomoon.css', __FILE__ ) ); | |
if ( !is_admin() ) { | |
wp_enqueue_style( 'id24-social-share', plugins_url( 'css/id24.css', __FILE__ ), array( 'dashicons', 'id24-icomoon' ) ); | |
} | |
} |
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
/* | |
* Use WordPress filter 'the_content' to add sharing links into post content. | |
* | |
* @param $content The current content of the post. | |
* | |
* @return $content The previous content of the post plus social sharing links. | |
*/ | |
add_filter( 'the_content', 'id24_post_content' ); | |
function id24_post_content( $content ) { | |
global $post; |
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
/* | |
* Fetch HTML for links and wrap in a container. Add heading and ARIA landmark role. | |
* | |
* @param integer $post_ID of current post. | |
* | |
* @return full HTML block. | |
*/ | |
function id24_social_block( $post_ID ) { | |
$links = id24_create_links( $post_ID ); | |
NewerOlder