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
https://stackoverflow.com/questions/8538362/how-do-i-move-a-git-repo-from-beanstalk-to-github | |
# In this example, we use an external account named extuser and | |
# a GitHub account named ghuser to transfer repo.git |
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
/** | |
* Call before the Donation Receipt text is display | |
*/ | |
function give_custom_give_payment_receipt_header_before_callback() { | |
add_filter( 'gettext', 'child_give_text_switcher', 10, 3 ); | |
} | |
add_action( 'give_payment_receipt_header_before', 'give_custom_give_payment_receipt_header_before_callback' ); | |
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
// if ( isset( $_GET['debug123'] ) ) { | |
function bb_track_log( $end = false ) { | |
static $starttime; | |
if ( ! $end ) { | |
$starttime = time(); | |
register_shutdown_function( | |
function() { | |
bb_track_log( true ); | |
} |
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 | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
/** | |
* Set the schedule action hook for update the permission | |
*/ | |
function file_update_permission_as_schedule_recurring_action( $product_id, $new_download_ids ) { |
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 bb_theme_giveaway_edit_posts_callback( $capabilities ) { | |
if ( is_page( 'giveaway' ) || ( ! empty( $_SERVER ) && ! empty( $_SERVER['HTTP_REFERER'] ) && strpos( $_SERVER['HTTP_REFERER'], '/giveaway/' ) !== false ) ) { | |
$capabilities['upload_files'] = 1; | |
$capabilities['edit_posts'] = 1; | |
$capabilities['edit_post'] = 1; | |
$capabilities['edit_published_posts'] = 1; | |
} | |
return $capabilities; |
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 bbdfy_acf_require_custom_message( $field ) { | |
acf_render_field_setting( | |
$field, | |
array( | |
'label' => __( 'Custom Error Message', 'acf' ), | |
'instructions' => __( 'Error Message to display when feidls is require and not submitted.', 'acf' ), | |
'type' => 'textarea', | |
'name' => 'custom_error_message', | |
'rows' => 5, | |
), |
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
# π WP CLI Auto Completion | |
# autoload bashcompinit | |
# bashcompinit | |
# source ~/wp-completion.bash | |
# π Helpers | |
alias reload_alias="source ~/.zshrc" | |
alias edit_zsh="code ~/.zshrc" | |
alias edit_alias="code ~/.aliases" | |
alias edit_hosts="code /etc/hosts" |
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 in the CPT | |
*/ | |
function CPT_filter_by_taxonomies( $post_type, $which ) { | |
// Apply this only on a specific post type | |
if ( 'CPT' !== $post_type ) { | |
return; | |
} |
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
DELETE FROM wp_postmeta where post_id IN (SELECT ID from wp_posts where post_type = 'shop_subscription' ); | |
DELETE FROM wp_comments where comment_post_ID IN (SELECT ID from wp_posts where post_type = 'shop_subscription' ); | |
DELETE from wp_posts where post_type = 'shop_subscription' | |
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: Custom WooCommerce Webhook | |
* Plugin URI: https://raftaar1191.com/ | |
* Description: This plugin provided a demo of Custom WooCommerce Webhook | |
* Author: raftaar1191 | |
* Author URI: https://profiles.wordpress.org/raftaar1191/ | |
* Version: 1.0.0 | |
*/ |