esc_attr example



    /** * Render the section, and the controls that have been added to it. * * @since 4.3.0 * @deprecated 4.9.0 */
    protected function render() {
        _deprecated_function( __METHOD__, '4.9.0' );
        ?> <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="accordion-section-new-menu"> <button type="button" class="button add-new-menu-item add-menu-toggle" aria-expanded="false"> <?php echo esc_html( $this->title ); ?> </button> <ul class="new-menu-section-content"></ul> </li> <?php     }
}
echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
            break;
        case 'libraries':
            array_walk( $group_data['data'], '_wp_credits_build_object_link' );
            echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
            break;
        default:
            $compact = 'compact' === $group_data['type'];
            $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
            echo '<ul class="' . $classes . '" id="wp-people-group-' . $slug . '">' . "\n";
            foreach ( $group_data['data'] as $person_data ) {
                echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
                echo '<a href="' . esc_url( sprintf( $credits_data['profiles']$person_data[2] ) ) . '" class="web">';
                $size   = $compact ? 80 : 160;
                $data   = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
                $data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size * 2 ) );
                echo '<span class="wp-person-avatar"><img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="" /></span>' . "\n";
                echo esc_html( $person_data[0] ) . "</a>\n\t";
                if ( ! $compact && ! empty( $person_data[3] ) ) {
                    // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText                     echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
                }
                echo "</li>\n";
            }


    /** * Renders the control wrapper and calls $this->render_content() for the internals. * * @since 3.4.0 */
    protected function render() {
        $id    = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' )$this->id );
        $class = 'customize-control customize-control-' . $this->type;

        printf( '<li id="%s" class="%s">', esc_attr( $id )esc_attr( $class ) );
        $this->render_content();
        echo '</li>';
    }

    /** * Get the data link attribute for a setting. * * @since 3.4.0 * @since 4.9.0 Return a `data-customize-setting-key-link` attribute if a setting is not registered for the supplied setting key. * * @param string $setting_key * @return string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered setting, * and a `data-customize-setting-key-link` attribute if the setting is not yet registered. */
$most_recent_url = '';
    $view_all_url    = '';
    $search_url      = '';

    if ( $nav_menu_selected_id ) {
        $most_recent_url = add_query_arg( $tab_name, 'most-recent', remove_query_arg( $removed_args ) );
        $view_all_url    = add_query_arg( $tab_name, 'all', remove_query_arg( $removed_args ) );
        $search_url      = add_query_arg( $tab_name, 'search', remove_query_arg( $removed_args ) );
    }
    ?> <div id="<?php echo esc_attr( "posttype-{$post_type_name}); ?>" class="posttypediv"> <ul id="<?php echo esc_attr( "posttype-{$post_type_name}-tabs" ); ?>" class="posttype-tabs add-menu-item-tabs"> <li <?php echo ( 'most-recent' === $current_tab ? ' class="tabs"' : '' ); ?>> <a class="nav-tab-link" data-type="<?php echo esc_attr( "tabs-panel-posttype-{$post_type_name}-most-recent" ); ?>" href="<?php echo esc_url( $most_recent_url . "#tabs-panel-posttype-{$post_type_name}-most-recent" ); ?>" > <?php _e( 'Most Recent' ); ?> </a> </li> <li <?php echo ( 'all' === $current_tab ? ' class="tabs"' : '' ); ?>> <a class="nav-tab-link" data-type="
return '';
    }

    $avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar(
        $author_id,
        $attributes['avatarSize']
    ) : null;

    $link        = get_author_posts_url( $author_id );
    $author_name = get_the_author_meta( 'display_name', $author_id );
    if ( ! empty( $attributes['isLink'] && ! empty( $attributes['linkTarget'] ) ) ) {
        $author_name = sprintf( '<a href="%1$s" target="%2$s">%3$s</a>', esc_url( $link )esc_attr( $attributes['linkTarget'] )$author_name );
    }

    $byline  = ! empty( $attributes['byline'] ) ? $attributes['byline'] : false;
    $classes = array();
    if ( isset( $attributes['itemsJustification'] ) ) {
        $classes[] = 'items-justified-' . $attributes['itemsJustification'];
    }
    if ( isset( $attributes['textAlign'] ) ) {
        $classes[] = 'has-text-align-' . $attributes['textAlign'];
    }
    if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
        

function get_default_link_to_edit() {
    $link = new stdClass();
    if ( isset( $_GET['linkurl'] ) ) {
        $link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
    } else {
        $link->link_url = '';
    }

    if ( isset( $_GET['name'] ) ) {
        $link->link_name = esc_attr( wp_unslash( $_GET['name'] ) );
    } else {
        $link->link_name = '';
    }

    $link->link_visible = 'Y';

    return $link;
}

/** * Deletes a specified link from the database. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $link_id ID of the link to delete. * @return true Always true. */

    public function form( $instance ) {
        $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
        $title    = $instance['title'];
        ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> </p> <?php     }

    /** * Handles updating settings for the current Search widget instance. * * @since 2.8.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Updated settings. */
/* translators: %s: Host name. */
                        __( 'The internet address of your network will be %s.' ),
                        '<code>' . $hostname . '</code>'
                    );
                    ?> </td> </tr> <?php endif; ?> <tr> <th scope='row'><label for="sitename"><?php esc_html_e( 'Network Title' ); ?></label></th> <td> <input name='sitename' id='sitename' type='text' size='45' value='<?php echo esc_attr( $site_name ); ?>' /> <p class="description"> <?php _e( 'What would you like to call your network?' ); ?> </p> </td> </tr> <tr> <th scope='row'><label for="email"><?php esc_html_e( 'Network Admin Email' ); ?></label></th> <td> <input name='email' id='email' type='text' size='45' value='<?php echo esc_attr( $admin_email ); ?>' /> <p class="description"> <?php _e( 'Your email address.' ); ?>
?> </h1> <a href="link-add.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'link' ); ?></a> <hr class="wp-header-end"> <?php if ( isset( $_GET['added'] ) ) : ?> <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Link added.' ); ?></p></div> <?php endif; ?> <form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php"> <?php if ( ! empty( $link_added ) ) {
    echo $link_added;
}

wp_nonce_field( $nonce_action );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
?> <div id="poststuff"> <div id="post-body" class="metabox-holder columns-
$content  = sprintf(
                $set_thumbnail_link,
                esc_url( $upload_iframe_src ),
                ' aria-describedby="set-post-thumbnail-desc"',
                $thumbnail_html
            );
            $content .= '<p class="hide-if-no-js howto" id="set-post-thumbnail-desc">' . __( 'Click the image to edit or update' ) . '</p>';
            $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>';
        }
    }

    $content .= '<input type="hidden" id="_thumbnail_id" name="_thumbnail_id" value="' . esc_attr( $thumbnail_id ? $thumbnail_id : '-1' ) . '" />';

    /** * Filters the admin post thumbnail HTML markup to return. * * @since 2.9.0 * @since 3.5.0 Added the `$post_id` parameter. * @since 4.6.0 Added the `$thumbnail_id` parameter. * * @param string $content Admin post thumbnail HTML markup. * @param int $post_id Post ID. * @param int|null $thumbnail_id Thumbnail attachment ID, or null if there isn't one. */
// If the script is needed, but it was previously removed, add it again.             if ( $is_expandable_searchfield && ! in_array( $view_js_file$script_handles, true ) ) {
                $block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
            }
        }
    }

    if ( count( $query_params ) > 0 ) {
        foreach ( $query_params as $param => $value ) {
            $query_params_markup .= sprintf(
                '<input type="hidden" name="%s" value="%s" />',
                esc_attr( $param ),
                esc_attr( $value )
            );
        }
    }

    if ( $show_button ) {
        $button_classes         = array( 'wp-block-search__button' );
        $button_internal_markup = '';
        if ( ! empty( $color_classes ) ) {
            $button_classes[] = $color_classes;
        }
        
'title_li'     => '',
        'hide_empty'   => empty( $attributes['showEmpty'] ),
    );
    if ( ! empty( $attributes['showOnlyTopLevel'] ) && $attributes['showOnlyTopLevel'] ) {
        $args['parent'] = 0;
    }

    if ( ! empty( $attributes['displayAsDropdown'] ) ) {
        $id                       = 'wp-block-categories-' . $block_id;
        $args['id']               = $id;
        $args['show_option_none'] = __( 'Select Category' );
        $wrapper_markup           = '<div %1$s><label class="screen-reader-text" for="' . esc_attr( $id ) . '">' . __( 'Categories' ) . '</label>%2$s</div>';
        $items_markup             = wp_dropdown_categories( $args );
        $type                     = 'dropdown';

        if ( ! is_admin() ) {
            // Inject the dropdown script immediately after the select dropdown.             $items_markup = preg_replace(
                '#(?<=</select>)#',
                build_dropdown_script_block_core_categories( $id ),
                $items_markup,
                1
            );
        }
$href = add_query_arg(
                array(
                    'tab'            => $callback,
                    's'              => false,
                    'paged'          => false,
                    'post_mime_type' => false,
                    'm'              => false,
                )
            );
            $link = "<a href='" . esc_url( $href ) . "'$class>$text</a>";
            echo "\t<li id='" . esc_attr( "tab-$callback) . "'>$link</li>\n";
        }

        echo "</ul>\n";
    }
}

/** * Retrieves the image HTML to send to the editor. * * @since 2.5.0 * * @param int $id Image attachment ID. * @param string $caption Image caption. * @param string $title Image title attribute. * @param string $align Image CSS alignment property. * @param string $url Optional. Image src URL. Default empty. * @param bool|string $rel Optional. Value for rel attribute or whether to add a default value. Default false. * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). Default 'medium'. * @param string $alt Optional. Image alt attribute. Default empty. * @return string The HTML output to insert into the editor. */
<?php             if ( $wp_customize instanceof WP_Customize_Manager ) {
                $url = 'javascript: wp.customize.panel( "nav_menus" ).focus();';
            } else {
                $url = admin_url( 'nav-menus.php' );
            }

            printf(
                /* translators: %s: URL to create a new menu. */
                __( 'No menus have been created yet. <a href="%s">Create some</a>.' ),
                // The URL can be a `javascript:` link, so esc_attr() is used here instead of esc_url().                 esc_attr( $url )
            );
            ?> </p> <div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id( 'nav_menu' ); ?>"><?php _e( 'Select Menu:' ); ?></label> <select id="<?php echo $this->get_field_id( 'nav_menu' ); ?>" name="<?php echo $this->get_field_name( 'nav_menu' ); ?>"> <option value="0">
continue;
        } else {
            $cat_id = $cat_id['term_id'];
        }

        $cat_name = esc_html( $cat_name );

        $x->add(
            array(
                'what'     => 'link-category',
                'id'       => $cat_id,
                'data'     => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='" . esc_attr( $cat_id ) . "' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>",
                'position' => -1,
            )
        );
    }
    $x->send();
}

/** * Handles adding a tag via AJAX. * * @since 3.1.0 */
Home | Imprint | This part of the site doesn't use cookies.