/** * Change the payment field value based on user role. * * @param array $properties The field properties. * @param array $field The field settings. * @param array $form_data The form data. * * @return array */ add_filter( ‘wpforms_field_properties’,…Continue reading
add_filter( ‘wpforms_field_properties’, ‘custom_address_state_optional’, 10, 3 ); function custom_address_state_optional( $properties, $field, $form_data ) { // Check if the field is an Address field. if ( ‘address’ === $field[‘type’] ) { // Set the ‘required’ property of the ‘state’ subfield to false.…Continue reading
function custom_hide_sidebar_on_mobile() { echo ‘ ‘; } add_action(‘wp_head’, ‘custom_hide_sidebar_on_mobile’);Continue reading
add_action( ‘template_redirect’, function() { if (is_404()) { wp_safe_redirect(home_url()); exit(); } } );Continue reading
/** * IMPORTANT: After activating this snippet you have to change the default avatar option in Settings » Discussion to “Custom Avatar” as defined below. */ add_filter( ‘avatar_defaults’, function( $avatar_defaults ) { $new_avatar_url = ‘https://wpcode.com/wp-content/uploads/2024/09/wpcode-avatar.png’; // Replace this with your…Continue reading
$number_of_posts = 5; // Change this to the number of random posts you want to display. $title = ‘You might also like:’; // This is the title that will be displayed above the list of posts. $current_post_id = get_the_ID(); $args…Continue reading