sanitize_title_with_dashes example

$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
                $removed = '<div class="notice notice-info inline"><p>' . sprintf( $removed$date ) . '</p></div>';
            } elseif ( ! empty( $section['updated'] ) ) {
                $badge_class = ' blue';
                $date        = date_i18n( $date_format$section['updated'] );
                /* translators: %s: Date of privacy policy text update. */
                $badge_title = sprintf( __( 'Updated %s.' )$date );
            }

            $plugin_name = esc_html( $section['plugin_name'] );

            $sanitized_policy_name = sanitize_title_with_dashes( $plugin_name );
            ?> <h4 class="privacy-settings-accordion-heading"> <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button"> <span class="title"><?php echo $plugin_name; ?></span> <?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?> <span class="badge <?php echo $badge_class; ?>"> <?php echo $badge_title; ?></span> <?php endif; ?> <span class="icon"></span> </button> </h4> <div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">

function wp_privacy_generate_personal_data_export_group_html( $group_data$group_id = '', $groups_count = 1 ) {
    $group_id_attr = sanitize_title_with_dashes( $group_data['group_label'] . '-' . $group_id );

    $group_html  = '<h2 id="' . esc_attr( $group_id_attr ) . '">';
    $group_html .= esc_html( $group_data['group_label'] );

    $items_count = count( (array) $group_data['items'] );
    if ( $items_count > 1 ) {
        $group_html .= sprintf( ' <span class="count">(%d)</span>', $items_count );
    }

    $group_html .= '</h2>';

    
if ( is_wp_error( $api_tags ) ) {
        echo $api_tags->get_error_message();
    } else {
        // Set up the tags in a way which can be interpreted by wp_generate_tag_cloud().         $tags = array();
        foreach ( (array) $api_tags as $tag ) {
            $url                  = self_admin_url( 'plugin-install.php?tab=search&type=tag&s=' . urlencode( $tag['name'] ) );
            $data                 = array(
                'link'  => esc_url( $url ),
                'name'  => $tag['name'],
                'slug'  => $tag['slug'],
                'id'    => sanitize_title_with_dashes( $tag['name'] ),
                'count' => $tag['count'],
            );
            $tags[ $tag['name'] ] = (object) $data;
        }
        echo wp_generate_tag_cloud(
            $tags,
            array(
                /* translators: %s: Number of plugins. */
                'single_text'   => __( '%s plugin' ),
                /* translators: %s: Number of plugins. */
                'multiple_text' => __( '%s plugins' ),
            )
// Send the locale to the API so it can provide context-sensitive results.             'locale'   => get_user_locale(),
        );

        switch ( $tab ) {
            case 'search':
                $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
                $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';

                switch ( $type ) {
                    case 'tag':
                        $args['tag'] = sanitize_title_with_dashes( $term );
                        break;
                    case 'term':
                        $args['search'] = $term;
                        break;
                    case 'author':
                        $args['author'] = $term;
                        break;
                }

                break;

            
$this->cap = get_post_type_capabilities( (object) $args );
        unset( $args['capabilities'] );

        if ( is_array( $args['capability_type'] ) ) {
            $args['capability_type'] = $args['capability_type'][0];
        }

        if ( false !== $args['query_var'] ) {
            if ( true === $args['query_var'] ) {
                $args['query_var'] = $this->name;
            } else {
                $args['query_var'] = sanitize_title_with_dashes( $args['query_var'] );
            }
        }

        if ( false !== $args['rewrite'] && ( is_admin() || get_option( 'permalink_structure' ) ) ) {
            if ( ! is_array( $args['rewrite'] ) ) {
                $args['rewrite'] = array();
            }
            if ( empty( $args['rewrite']['slug'] ) ) {
                $args['rewrite']['slug'] = $this->name;
            }
            if ( ! isset( $args['rewrite']['with_front'] ) ) {
                
// Check for support for utf8 in the installed PCRE library once and store the result in a static.     static $utf8_pcre = null;
    if ( ! isset( $utf8_pcre ) ) {
        // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged         $utf8_pcre = @preg_match( '/^./u', 'a' );
    }

    if ( ! seems_utf8( $filename ) ) {
        $_ext     = pathinfo( $filename, PATHINFO_EXTENSION );
        $_name    = pathinfo( $filename, PATHINFO_FILENAME );
        $filename = sanitize_title_with_dashes( $_name ) . '.' . $_ext;
    }

    if ( $utf8_pcre ) {
        $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
    }

    /** * Filters the list of characters to remove from a filename. * * @since 2.8.0 * * @param string[] $special_chars Array of characters to remove. * @param string $filename_raw The original filename to be sanitized. */
$args = array_merge( $defaults$args );

        // If not set, default to the setting for 'public'.         if ( null === $args['publicly_queryable'] ) {
            $args['publicly_queryable'] = $args['public'];
        }

        if ( false !== $args['query_var'] && ( is_admin() || false !== $args['publicly_queryable'] ) ) {
            if ( true === $args['query_var'] ) {
                $args['query_var'] = $this->name;
            } else {
                $args['query_var'] = sanitize_title_with_dashes( $args['query_var'] );
            }
        } else {
            // Force 'query_var' to false for non-public taxonomies.             $args['query_var'] = false;
        }

        if ( false !== $args['rewrite'] && ( is_admin() || get_option( 'permalink_structure' ) ) ) {
            $args['rewrite'] = wp_parse_args(
                $args['rewrite'],
                array(
                    'with_front'   => true,
                    
Home | Imprint | This part of the site doesn't use cookies.