diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
old mode 100644
new mode 100755
index 03ff4e7..72b3c2e
a
|
b
|
function get_submit_button( $text = '', $type = 'primary large', $name = 'submit |
1900 | 1900 | |
1901 | 1901 | $attributes = ''; |
1902 | 1902 | if ( is_array( $other_attributes ) ) { |
1903 | | foreach ( $other_attributes as $attribute => $value ) { |
1904 | | $attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important |
1905 | | } |
| 1903 | $attributes = html_attributes( $other_attributes ); |
1906 | 1904 | } elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string |
1907 | | $attributes = $other_attributes; |
| 1905 | $attributes = ' ' . $other_attributes; |
1908 | 1906 | } |
1909 | 1907 | |
1910 | | // Don't output empty name and id attributes. |
1911 | | $name_attr = $name ? ' name="' . esc_attr( $name ) . '"' : ''; |
1912 | | $id_attr = $id ? ' id="' . esc_attr( $id ) . '"' : ''; |
| 1908 | $atts = array( |
| 1909 | 'type' => 'submit', |
| 1910 | 'name' => $name, |
| 1911 | 'id' => $id, |
| 1912 | 'class' => $class, |
| 1913 | 'value' => $text, |
| 1914 | ); |
1913 | 1915 | |
1914 | | $button = '<input type="submit"' . $name_attr . $id_attr . ' class="' . esc_attr( $class ); |
1915 | | $button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />'; |
| 1916 | $button = '<input' . html_attributes( $atts ) . $attributes . ' />'; |
1916 | 1917 | |
1917 | 1918 | if ( $wrap ) { |
1918 | 1919 | $button = '<p class="submit">' . $button . '</p>'; |
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
old mode 100644
new mode 100755
index 1f6e3b1..b997b11
a
|
b
|
function wp_delete_file( $file ) { |
4845 | 4845 | @unlink( $delete ); |
4846 | 4846 | } |
4847 | 4847 | } |
| 4848 | |
| 4849 | /** |
| 4850 | * Get HTML attributes. |
| 4851 | * |
| 4852 | * @since 4.3.0 |
| 4853 | * |
| 4854 | * @param array $attrs |
| 4855 | * @return string |
| 4856 | */ |
| 4857 | function html_attributes( $attrs ) { |
| 4858 | if ( ! is_array( $attrs ) ) { |
| 4859 | return false; |
| 4860 | } |
| 4861 | |
| 4862 | $html = array(); |
| 4863 | |
| 4864 | foreach ( (array) $attrs as $attr => $value ) { |
| 4865 | if ( is_numeric( $attr ) ) { |
| 4866 | $attr = $value; |
| 4867 | } |
| 4868 | |
| 4869 | if ( ! empty( $value ) ) { |
| 4870 | $value = 'href' == $attr ? esc_url( $value ) : esc_attr( $value ); |
| 4871 | |
| 4872 | $html[] = $attr . '="' . $value . '"'; |
| 4873 | } |
| 4874 | } |
| 4875 | |
| 4876 | return count( $html ) > 0 ? ' ' . implode( ' ', $html ) : ''; |
| 4877 | } |
diff --git a/wp-includes/media.php b/wp-includes/media.php
old mode 100644
new mode 100755
index b69b328..7520128
a
|
b
|
function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = fa |
758 | 758 | * @param string|array $size Requested size. |
759 | 759 | */ |
760 | 760 | $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size ); |
761 | | $attr = array_map( 'esc_attr', $attr ); |
762 | | $html = rtrim("<img $hwstring"); |
763 | | foreach ( $attr as $name => $value ) { |
764 | | $html .= " $name=" . '"' . $value . '"'; |
765 | | } |
766 | | $html .= ' />'; |
| 761 | |
| 762 | $html = '<img ' . rtrim( $hwstring ) . html_attributes( $attr ) . ' />'; |
767 | 763 | } |
768 | 764 | |
769 | 765 | return $html; |
… |
… |
function img_caption_shortcode( $attr, $content = null ) { |
879 | 875 | if ( $atts['width'] < 1 || empty( $atts['caption'] ) ) |
880 | 876 | return $content; |
881 | 877 | |
882 | | if ( ! empty( $atts['id'] ) ) |
883 | | $atts['id'] = 'id="' . esc_attr( $atts['id'] ) . '" '; |
884 | | |
885 | | $class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] ); |
886 | | |
| 878 | $html_atts = array( |
| 879 | 'id' => $atts['id'], |
| 880 | 'style' => 'width: ' . (int) $atts['width'] . 'px;', |
| 881 | 'class' => trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] ) |
| 882 | ); |
| 883 | |
887 | 884 | if ( current_theme_supports( 'html5', 'caption' ) ) { |
888 | | return '<figure ' . $atts['id'] . 'style="width: ' . (int) $atts['width'] . 'px;" class="' . esc_attr( $class ) . '">' |
| 885 | return '<figure' . html_attributes( $html_atts ) . '>' |
889 | 886 | . do_shortcode( $content ) . '<figcaption class="wp-caption-text">' . $atts['caption'] . '</figcaption></figure>'; |
890 | 887 | } |
891 | 888 | |
… |
… |
function img_caption_shortcode( $attr, $content = null ) { |
908 | 905 | */ |
909 | 906 | $caption_width = apply_filters( 'img_caption_shortcode_width', $caption_width, $atts, $content ); |
910 | 907 | |
911 | | $style = ''; |
912 | | if ( $caption_width ) |
913 | | $style = 'style="width: ' . (int) $caption_width . 'px" '; |
914 | | |
915 | | return '<div ' . $atts['id'] . $style . 'class="' . esc_attr( $class ) . '">' |
| 908 | if ( $caption_width ) { |
| 909 | $html_atts['style'] = 'width: ' . (int) $caption_width . 'px;'; |
| 910 | } |
| 911 | |
| 912 | return '<div' . html_attributes( $html_atts ) . '>' |
916 | 913 | . do_shortcode( $content ) . '<p class="wp-caption-text">' . $atts['caption'] . '</p></div>'; |
917 | 914 | } |
918 | 915 | |
… |
… |
function wp_audio_shortcode( $attr, $content = '' ) { |
1641 | 1638 | } |
1642 | 1639 | } |
1643 | 1640 | |
1644 | | $attr_strings = array(); |
1645 | | foreach ( $html_atts as $k => $v ) { |
1646 | | $attr_strings[] = $k . '="' . esc_attr( $v ) . '"'; |
1647 | | } |
1648 | | |
1649 | 1641 | $html = ''; |
1650 | 1642 | if ( 'mediaelement' === $library && 1 === $instance ) { |
1651 | 1643 | $html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n"; |
1652 | 1644 | } |
1653 | | $html .= sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) ); |
1654 | | |
| 1645 | $html .= '<audio controls="controls"' . html_attributes( $html_atts ) . '>'; |
| 1646 | |
1655 | 1647 | $fileurl = ''; |
1656 | 1648 | $source = '<source type="%s" src="%s" />'; |
1657 | 1649 | foreach ( $default_types as $fallback ) { |
diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php
old mode 100644
new mode 100755
index 5feac80..a13d325
a
|
b
|
class Walker_Nav_Menu extends Walker { |
140 | 140 | */ |
141 | 141 | $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth ); |
142 | 142 | |
143 | | $attributes = ''; |
144 | | foreach ( $atts as $attr => $value ) { |
145 | | if ( ! empty( $value ) ) { |
146 | | $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); |
147 | | $attributes .= ' ' . $attr . '="' . $value . '"'; |
148 | | } |
149 | | } |
150 | | |
151 | 143 | $item_output = $args->before; |
152 | | $item_output .= '<a'. $attributes .'>'; |
| 144 | $item_output .= '<a' . html_attributes( $atts ) . '>'; |
153 | 145 | /** This filter is documented in wp-includes/post-template.php */ |
154 | 146 | $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; |
155 | 147 | $item_output .= '</a>'; |