FD Mitarbeiter Vorname Name als Titel übernehmen

function sync_acf_post_title($post_id, $post, $update) { $acf_name = get_field(‘name’, $post_id); // Get the value of the “name” ACF field $acf_vorname = get_field(‘vorname’, $post_id); // Get the value of the “vorname” ACF field $post_type = get_post_type($post_id); if ($acf_name && $post_type === “mitarbeiterinnen”)…Continue reading

Hide user account from the users list

//* Hide this administrator account from the users list add_action(‘pre_user_query’,’site_pre_user_query’); function site_pre_user_query($user_search) { global $current_user; $username = $current_user->user_login; if ($username == ‘mediAdmin’) { } else { global $wpdb; $user_search->query_where = str_replace(‘WHERE 1=1’, “WHERE 1=1 AND {$wpdb->users}.user_login != ‘mediAdmin’”,$user_search->query_where); } }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

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