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
/** | |
* Get associative array of sample results for keywords | |
* | |
* @param string $existing_keywords | |
* | |
* @param int $post_id | |
* | |
* @return array | |
*/ | |
public function get_samples( $existing_keywords = '', $post_id = 0 ) { |
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
SELECT * FROM wp_posts | |
LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id | |
WHERE wp_posts.post_status = 'publish' | |
AND wp_postmeta.meta_value = '%ACF_FIELD_VALUE%' | |
ORDER BY wp_posts.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
function test_for_page_template() { | |
$args = array( | |
'post_type' => 'page', | |
'meta_query' => array( | |
array( | |
'key' => '_wp_page_template', | |
'value' => 'PAGETEMPLATE.php' | |
) | |
) | |
); |
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
/** | |
* Uploads an image from remote url and sets as featured image of the new post | |
* | |
* @param int $post_id The id of the new post | |
* @param string $thumbnail_url Url of the preview image hosted by BrightTalk | |
*/ | |
private function image_handler( $post_id, $thumbnail_url ) { | |
$image_url = $thumbnail_url; // Define the image URL here | |
$image_name = basename( $thumbnail_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
alias gtree='git log --graph --abbrev-commit --decorate --date=relative --format=format:'\''%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'\'' --all' |
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_filter( 'acf/load_value/name=content_blocks', 'default_fields', 10, 3 ); | |
function default_fields( $value, $post_id, $field ) { | |
// Only add default content for new posts | |
if ( $value !== null ) { | |
return $value; | |
} | |
// Only add default content for certain post types | |
if ( ! in_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
location ~* .(png|jpe?g|gif|ico|svg)$ { | |
expires 24h; | |
log_not_found off; | |
root '/Users/USERNAME/.valet/Sites/mixpanel/’; | |
if (-f $request_filename) { | |
break; | |
} | |
try_files $uri $uri/ @production; | |
} |
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_filter( 'gform_field_validation', 'PREFIX_gravity_forms_blacklist', 10, 4 ); | |
/** | |
* Added Validation check for email vs blacklist of free email accounts. | |
* | |
* @param $result array The validation result to be filtered | |
* @param $value string|array The field value to be validated | |
* @param $form object Current Form object | |
* @param $field object Current Field object | |
* | |
* @return mixed |
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
$regex = "/([0-9]{1,2}:[0-9]{2}:[0-9]{2})\s(AM|PM|XM)\s{0,1}\*{3}\s{0,3}\ *{1,2}LOCAL.*?([0-9]{1,2}:[0-9]{2})/"; |
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 removeHash () { | |
var scrollV, scrollH, loc = window.location; | |
if ("pushState" in history) | |
history.pushState("", document.title, loc.pathname + loc.search); | |
else { | |
// Prevent scrolling by storing the page's current scroll offset | |
scrollV = document.body.scrollTop; | |
scrollH = document.body.scrollLeft; | |
loc.hash = ""; |
NewerOlder