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 all_woocommerce_cart_expire_timeout(){ | |
global $prod_ids; | |
global $product_timeout; | |
function action_woocommerce_add_to_cart( $array, $int, $int ) { | |
function perform_task() { | |
$start_time = time(); | |
return $start_time; | |
} |
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 | |
class My_Custom_My_Account_Endpoint { | |
/** | |
* Custom endpoint name. | |
* | |
* @var string | |
*/ | |
public static $endpoint = 'my-custom-endpoint'; |
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 | |
/** | |
* Plugin Name: Woocommerce Vendors Bookings Management | |
* Description: Allows vendors to manage their bookings in the frontend | |
* Version: 1.0.0 | |
* Author: Liam Bailey | |
* Author URI: http://webbyscots.com/ | |
* License: GNU General Public License v3.0 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ |
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 | |
/* | |
* Plugin Name: Cancel Unpaid Bookings | |
* Author: WooThemes | |
* Description: Allows booking orders to be canceled by the cancel unpaid orders cron job. | |
*/ | |
// woocommerce-cancel-unpaid-bookings.php | |
function woocommerce_cancel_unpaid_booking_orders_from_admin( $return, $order ) { |
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
//not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
add_filter( 'woocommerce_booking_single_check_availability_text', 'wooninja_booking_check_availability_text' ); | |
function wooninja_booking_check_availability_text() { | |
return "MY CUSTOM TEXT"; | |
} |
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_new_booking', 'wooninja_send_pending_confirmation_email', 10, 1 ); | |
function wooninja_send_pending_confirmation_email( $booking_id ) { | |
$what_that = get_wc_booking( $booking_id ); | |
$vendor_id = $what_that->custom_fields["_booking_vendor"]; | |
$vendor_id = intval($vendor_id[0]); | |
$GLOBALS['pending_conf_vendor'] = $vendor_id; | |
add_filter( 'woocommerce_email_recipient_new_booking', 'wc_send_new_booking_multiple_addresses' ); |
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 | |
// Init new Role and add all capability to editor and admin | |
function custom_post_type_capability_admin() | |
{ | |
// List the role that we want to give a full access | |
$roles = array('editor','administrator'); | |
// List of the post type that will have custom capability |
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 | |
/** | |
* class to customize dashboard of users | |
*/ | |
class CFA_dashboard{ | |
public $user_data; | |
public $username; | |
public function __construct() | |
{ |
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_filter( 't5_ajax_search_args', 'restrict_t5_search' ); | |
function restrict_t5_search( $args ) | |
{ | |
$args['post_type'] = array ( 'post', 'domicile' ); | |
#$args['cat'] = 47; | |
#$args['cat'] = 'php'; | |
$args['category_name'] = 'php'; | |
return $args; | |
} |
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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
NewerOlder