This file contains hidden or 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
/** | |
* Event On Modificacitons for Columns | |
*/ | |
// Remove the Default WordPress Columns | |
add_filter('manage_ajde_events_posts_columns', function ( $columns ) | |
{ | |
unset($columns['author'], $columns['tags']); | |
return $columns; | |
} ); | |
// Remove the EventOn Event Type 2 column |
This file contains hidden or 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_cars_by_taxonomies( $post_type, $which ) { | |
// Apply this only on a specific post type | |
if ( 'car' !== $post_type ) | |
return; | |
// A list of taxonomy slugs to filter by | |
$taxonomies = array( 'manufacturer', 'model', 'transmission', 'doors', 'color' ); | |
foreach ( $taxonomies as $taxonomy_slug ) { |
This file contains hidden or 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
/** | |
* Auto Complete all WooCommerce orders. | |
*/ | |
add_filter( 'woocommerce_payment_complete_order_status', 'cg_update_order_status', 10, 2 ); | |
function cg_update_order_status( $order_status, $order_id ) { | |
$order = new WC_Order( $order_id ); | |
if ( 'processing' == $order_status && ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) { |
This file contains hidden or 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
# Recommended cron tasks for Mautic 2 in Cloudways. | |
# All tasks are ran as www-data | |
# Output is ignored to avoid log file overhead. | |
# --quiet is used to reduce MySQL overhead on some tasks. | |
# --max-contacts is used to prevent one object's backlog from locking updates for other object. | |
# SEGMENTS | |
# Update all segments. | |
*/5 * * * * php /home/master/applications/fwhtzfeudw/public_html/app/console mautic:segments:update --max-contacts=10000 --quiet >/dev/null 2>&1 |
This file contains hidden or 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( 'woocommerce_order_item_meta_end', 'ts_order_item_meta_end', 10, 4 ); | |
function ts_order_item_meta_end( $item_id, $item, $order, $plain_text, $product ){ | |
global $product; | |
$product = wc_get_product(); | |
echo $product->get_weight(); | |
} |
This file contains hidden or 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 | |
/* | |
* More Refrences: https://docs.woocommerce.com/document/woocommerce-memberships-admin-hook-reference/ | |
* Function that checked if user has access to this specific content | |
* Usage: if(can_user_access_content(get_current_user_id(),$post->ID)){ } | |
*/ | |
function can_user_access_content($user_id,$post_id){ | |
//check if there's a force public on this content | |
if(get_post_meta($post_id,'_wc_memberships_force_public',true)=='yes') return true; | |
$args = array( 'status' => array( 'active' )); |
This file contains hidden or 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
// Related Events @+2.8 | |
case 'relatedEvents': | |
$events = $EVENT->get_prop('ev_releated'); | |
$events = !empty($events)? json_decode($events, true): false; | |
if($events && is_array($events)){ | |
ob_start(); | |
?> | |
<div class='evo_metarow_rel_events evorow bordb evcal_evdata_row'> |
This file contains hidden or 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 | |
/** | |
* ACF Pro repeater field shortcode | |
* | |
* I created this shortcode function because it didn't exist and it was being requested by others | |
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/ | |
* | |
* @attr {string} field - (Required) the name of the field that contains a repeater sub group | |
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group | |
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc |
This file contains hidden or 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 count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('button.is-following') || []; | |
} | |
async function unfollowAll() { | |
const buttons = getAllButtons(); |
This file contains hidden or 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
#!/usr/bin/env bash | |
########################################################################## | |
# Shellscript: Backup and update WordPress using wp-cli | |
# Author : Paco Orozco <[email protected]> | |
# Requires : wp-cli | |
########################################################################## | |
# Changelog | |
# 20170125: 1.0 | |
# Adds a default option to upgrade only when it's needed. | |
# 20161220: 0.1 |