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 | |
// sourced from https://www.ibenic.com/create-custom-wordpress-post-status/ and https://stackoverflow.com/a/49569592 | |
class WordPress_Custom_Post_Status { | |
/** | |
* Post Types for this status | |
* @var 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
<?php | |
if(!function_exists('array_keys_exists')){ | |
function array_keys_exists(array $keys, array $arr) { | |
return !array_diff_key(array_flip($keys), $arr); | |
} | |
} |
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
-- List all orphan rows from wp_postmeta | |
SELECT * FROM wp_postmeta | |
LEFT JOIN wp_posts ON wp_posts.ID = wp_postmeta.post_id | |
WHERE wp_posts.ID IS NULL; | |
-- Delete orphan postmeta | |
DELETE pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts p ON pm.post_id = p.ID | |
WHERE p.ID IS NULL; |
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 | |
/** | |
Adding support for ACF Extended (https://www.acf-extended.com/) | |
* Multiple New Field Groups | |
* 30+ New Field Types | |
update the following files for includes: | |
* inc/wpbakery/wpbakery_grid_element.php : 61 `include_once(ACFVC_PATH.'inc/acf_vc_helper_extended.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
jQuery(document).ready(function($){ | |
$('.tribe-organizer-email').each(function(i){ | |
$email = $.trim( $(this).text() ); | |
if( !$(this).has( "a" ).length ){ | |
$(this).html('<a href="mailto:' + $email + '">' + $email + '</a>'); | |
} | |
}) | |
}); |
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
<script> | |
window.addEventListener("load", function () { | |
$(function () { | |
$("body").append("<p>jQuery is available now!</p>"); | |
// Run my big jQuery function | |
}); | |
}, false); | |
</script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> |
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
img.gform_ajax_spinner { | |
position: fixed !important; | |
z-index: 999999; | |
left: 0; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
display: block !important; | |
overflow: hidden !important; | |
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
<?php | |
// add sku on woocommerce product editor >> general tab | |
add_action( 'woocommerce_product_options_general_product_data', 'add_the_sku_to_general_product_field' ); | |
function add_the_sku_to_general_product_field() { | |
global $post; | |
$product_sku = get_post_meta( $post->ID, '_sku', true ); | |
?> | |
<div class="options_group"> | |
<p class="form-field _sku_field "> |
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 t1.entity_id, t2.post_id, t2.post_title, t1.value, t3.address, t3.street, t3.city, t3.state, t3.zip, t4.phone, t4.mobile, t4.fax, t4.email, t4.website, DATE_FORMAT(FROM_UNIXTIME(t5.edited_at), "%Y-%m-%d") | |
FROM wp_sabai_entity_field_content_body as t1 | |
LEFT JOIN wp_sabai_content_post as t2 | |
ON t1.entity_id = t2.post_id | |
LEFT JOIN wp_sabai_entity_field_directory_location as t3 | |
ON t1.entity_id = t3.entity_id | |
LEFT JOIN wp_sabai_entity_field_directory_contact as t4 | |
ON t1.entity_id = t4.entity_id | |
LEFT JOIN wp_sabai_entity_field_content_activity as t5 | |
ON t1.entity_id = t5.entity_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
<?php | |
add_shortcode('sabai-directory-dashboard', 'sabai_directory_dashboard_get_shortcode'); | |
function sabai_directory_dashboard_get_shortcode($atts, $content, $tag){ | |
$platform = get_sabai_platform(); | |
$path = $platform->getSabai()->getAddon('Directory')->getSlug('dashboard'); | |
return $platform->shortcode($path, (array)$atts, $content); | |
} |