Type: php
Remove WordPress Version Number
add_filter(‘the_generator’, ‘__return_empty_string’);Continue reading
Replace WordPress Logo on Login Page
add_filter( ‘login_head’, function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = ‘https://wpcode.com/wp-admin/images/wordpress-logo.svg’; $logo_width = 84; $logo_height = 84; printf( ‘ ‘, $custom_logo, $logo_width, $logo_height );…Continue reading
Add Featured Images to RSS Feeds
/** * Add the post thumbnail, if available, before the content in feeds. * * @param string $content The post content. * * @return string */ function wpcode_snippet_rss_post_thumbnail( $content ) { global $post; if ( has_post_thumbnail( $post->ID ) ) {…Continue reading
Disable Automatic Updates
// Disable core auto-updates add_filter( ‘auto_update_core’, ‘__return_false’ ); // Disa add_filter( ‘auto_update_theme’,Continue reading
WP Simple Pay: Use Custom Field Value as Stripe Payment Description
/** * @link https://library.wpcode.com/snippet/e5wnp95d/ */ add_filter( ‘simpay_get_paymentintent_args_from_payment_form_request’, /** * @param array $paymentintent_args Arguments for PaymentIntent. * @param SimplePay\Core\Abstracts\Form $form Form instance. * @param array $form_data Form data generated by the client. * @param array $form_values Values of named fields in…Continue reading
WP Simple Pay: Custom Server-Side Validation Before Payment Creation
/** * @link https://library.wpcode.com/snippet/ro8wgkow/ */ add_action( ‘simpay_before_payment_create’, /** * @param \WP_REST_Request WordPress REST API request. */ function( $request ) { // “Stripe Metadata Label” of the custom field. $custom_field_name = ‘Customer DOB’; // Retrieve form values. $fields = $request->get_param( ‘form_values’…Continue reading
WP Simple Pay: Conditionally Dequeue Scripts & Styles
/** * @link https://library.wpcode.com/editor/e5wn795d/ */ add_filter( ‘simpay_before_register_public_scripts’, /** * @var array $scripts * @return array $scripts */ function( $scripts ) { // Do not load any scripts unless the user is on one of these pages. if ( ! is_page(…Continue reading
WP Simple Pay: Hide reCAPTCHA Badge
/** * @link https://library.wpcode.com/snippet/ro8w3kow/ */ add_action( ‘simpay_form_before_form_bottom’, function() { ?> This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.Continue reading
WP Simple Pay: Remove Payment Page Compatibility Mode
/** * @link https://library.wpcode.com/snippet/d2zk9r2x/ */ add_filter( ‘simpay_payment_page_css_compatibility_mode’, ‘__return_false’ ); add_filter( ‘simpay_payment_page_js_compatibility_mode’, ‘__return_false’ );Continue reading