Disable Automatic Trash Emptying
add_action( ‘init’, function() { remove_action( ‘wp_scheduled_delete’, ‘wp_scheduled_delete’ ); } );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action( ‘init’, function() { remove_action( ‘wp_scheduled_delete’, ‘wp_scheduled_delete’ ); } );Continue reading
add_action( ‘wp_enqueue_scripts’, function() { wp_dequeue_style( ‘wp-block-library’ ); wp_dequeue_style( ‘wp-block-library-theme’ ); }, 110 );Continue reading
// Post Date Function function post_date(){ // If modified date if ( get_the_date() !== get_the_modified_date() ) { $dateTime = get_the_modified_date( ‘c’ ); $itemropType = ‘dateModified’; $date = ‘‘. get_the_modified_date() .’‘; } else { // If published date $dateTime = get_the_date(…Continue reading
/** * @link https://library.wpcode.com/snippet/e500y359/ * * @param string $separator Decimal separator. * @return string */ function simpay_custom_decimal_separator( $separator ) { return ‘,’; } add_filter( ‘simpay_decimal_separator’, ‘simpay_custom_decimal_separator’ );Continue reading
/** * @link https://library.wpcode.com/snippet/j57zqp2g/ */ add_filter( ‘simpay_decimal_places’, /** * @param int $places Number of decimal places. * @return int */ function( $places ) { return 0; } );Continue reading
/** * @link https://library.wpcode.com/snippet/rodjlwom/ */ add_filter( ‘simpay_custom_amount_field_type’, /** * @param string $input_type * @return string */ function ( $input_type ) { return ‘number’; } );Continue reading
/** * @link https://library.wpcode.com/snippet/7oq8llow/ * * @param \SimplePay\Core\PaymentForm\PriceOption[] $price_options Payment form price options. * @param \SimplePay\Core\Abstracts\Form $form Payment form. * @return \SimplePay\Core\PaymentForm\PriceOption[] */ add_filter( ‘simpay_get_payment_form_price_options’, function( $price_options, $form ) { // BEGIN UPDATES. $form_id = 150; // Payment form ID.…Continue reading
/** * @link https://library.wpcode.com/snippet/e5wng05d/ * * @param \Stripe\Event $event Stripe Event. * @param \Stripe\Subscription|\Stripe\PaymentIntent $object Stripe Subscription or PaymentIntent */ function simpay_add_metadata_to_customer( $event, $object ) { $customer_id = $object->customer->id; $customer = \SimplePay\Core\Payments\Stripe_API::request( ‘Customer’, ‘update’, $customer_id, array( ‘metadata’ => $object->metadata->toArray(), )…Continue reading
/** * @link https://library.wpcode.com/editor/ro8wd9ow/ */ add_filter( ‘simpay_get_paymentintent_args_from_payment_form_request’, /** * @param array $args Payment Intent arguments. * @param \SimplePay\Core\Abstracts\Form $form Form instance. */ function( $args, $form ) { $args[‘description’] = $form->item_description; return $args; }, 10, 2 );Continue reading