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
| /** | |
| * Always save card token for stripe: Save payment information to my account for future purchases. | |
| */ | |
| add_filter( 'wc_stripe_force_save_source', '__return_true' ); | |
| /** | |
| * Filter the HTML of the stripe credit card details | |
| */ | |
| function payment_gateway_field_html_stripe_callback( $field_html ) { | |
| $field_html = str_ireplace( '<fieldset', 'style=display:none; <fieldset', $field_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
| /** | |
| * Get the value before the save run | |
| */ | |
| function carbon_fields_should_save_field_value_callback( $save, $value, $field ) { | |
| $fields_id = 'crb_text'; | |
| error_log( print_r( carbon_get_theme_option( $fields_id ), true ) . "\n", 3, WP_CONTENT_DIR . '/debug_new1.log' ); | |
| error_log( print_r( $value, true ) . "\n", 3, WP_CONTENT_DIR . '/debug_new1.log' ); |
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
| /** | |
| * Get the responce from the data cms | |
| */ | |
| function get_responce_data_cms_get( $url ) { | |
| $param = array( | |
| 'timeout' => 30, | |
| 'headers' => array() | |
| ); |
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" |