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( 'admin_init', 'do_something_152677' ); | |
function do_something_152677 () { | |
// Global object containing current admin page | |
global $pagenow; | |
if ( 'edit.php' === $pagenow && ) && ( isset($_GET['post_type']) && 'heroes' == $_GET['post_type'] ) ) ) | |
// update vote counts postmeta | |
} | |
} |
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
$taxonomy = get_term( $category_id )->taxonomy; | |
// get all post IDs within selected category | |
$posts_in_category = new WP_Query( array( | |
'fields' => 'ids', | |
'tax_query' => array( | |
array( | |
'taxonomy' => $taxonomy, | |
'terms' => $category_id, | |
), |
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
.en__field--1895 .en__field__element--checkbox input { | |
margin-right: 5px !important; | |
float: left; | |
} | |
.en__field--1895 .en__field__element--checkbox label { | |
display: block; | |
margin: -3px 0 0; | |
overflow: hidden; | |
} |
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 | |
// update form id # (2) | |
add_action( 'gform_validation_2', 'custom_validate_not_too_old_pre_save' ); | |
function validate_old_enough_pre_save( $validation_result ) { | |
$birth_date = $_POST["input_16"]; | |
$birth_date = strtotime( $birth_date[0] . '/' . $birth_date[1] . '/' . $birth_date[2] ); | |
// user is under 13 |
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
$(document).on('gform_confirmation_loaded', function(){ | |
if ( window.location.pathname == '/' ){ | |
sendEvent( petaGA_FormCategory_eNews, petaGA_FormAction_Submitted, 'Subscribe to E-News: Front Page'); | |
} else { | |
sendEvent( petaGA_FormCategory_eNews, petaGA_FormAction_Submitted, 'Subscribe to E-News: Interior Page'); | |
} | |
}); |
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
$old_credits = array(); | |
$old_credits[] = get_metadata('post', 275142, '_media_credit', true); | |
$old_credits[] = get_metadata('post', 275142, '_media_credit_2', true); | |
$old_credits[] = get_metadata('post', 275142, '_media_credit_3', true); | |
if ( $old_credits ) { | |
$number = 0; | |
$number_credits = count($old_credits); | |
add_metadata( 'post', 275142, 'media_credit', $number_credits ); | |
add_metadata( 'post', 275142, '_media_credit', 'field_548e1e18a4b85' ); | |
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
<a name="respond"><span style="display: none;">Respond</span></a> | |
<div id="peta_comments"> | |
<?php | |
// Get comment count | |
$comment_count = wp_count_comments( get_the_ID() ); | |
// If there are comments, display note and comments | |
if ( $comment_count->approved > 0 ) { ?> | |
<h6>Commenting is closed.</h6> | |
<div class="clear"></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
mobile CSS: | |
@media only screen and (max-width: 480px) { | |
table[id=footer] table { | |
margin: 0 auto 0; | |
width: 100% !important; | |
} | |
} | |
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 filter_images($content){ | |
$original_content = $content; | |
$inlineImages = array(); | |
// Find all images with an ID in content | |
preg_match_all( '/wp-image-([^"]*)/i', $content, $inlineImages ); | |
if ($inlineImages) { | |
// For each image build the credit and add to content | |
foreach ($inlineImages[1] as $attachment_id) { |
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
<!doctype html> | |
<html class="no-js" lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>SVG Test Safari No Worky</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width"> | |
</head> | |
<body> | |
<div class="wrapper"> |
NewerOlder