From 5306c082956aebf01f50c2dafcba5759e7ce87eb Mon Sep 17 00:00:00 2001 From: Tim Gieseking Date: Wed, 26 Jun 2019 14:25:52 -0500 Subject: [PATCH] more escaping/translation fixes --- archive.php | 6 +++--- index.php | 6 +++--- lib/theme-acfblocks.php | 34 +++++++++++++++++----------------- lib/theme-functions.php | 10 +++++----- lib/theme-helpers.php | 2 +- lib/theme-setup.php | 14 +++++++------- search.php | 6 +++--- single.php | 8 ++++---- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/archive.php b/archive.php index 55d515a..4e01dd1 100755 --- a/archive.php +++ b/archive.php @@ -38,9 +38,9 @@ // Previous/next page navigation. the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'basetheme' ), - 'next_text' => __( 'Next page', 'basetheme' ), - 'before_page_number' => '' . __( 'Page', 'basetheme' ) . ' ', + 'prev_text' => esc_attr__( 'Previous page', 'basetheme' ), + 'next_text' => esc_attr__( 'Next page', 'basetheme' ), + 'before_page_number' => '' . esc_attr__( 'Page', 'basetheme' ) . ' ', ) ); diff --git a/index.php b/index.php index e2338fb..312a0f9 100755 --- a/index.php +++ b/index.php @@ -42,9 +42,9 @@ // Previous/next page navigation. the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'basetheme' ), - 'next_text' => __( 'Next page', 'basetheme' ), - 'before_page_number' => '' . __( 'Page', 'basetheme' ) . ' ', + 'prev_text' => esc_attr__( 'Previous page', 'basetheme' ), + 'next_text' => esc_attr__( 'Next page', 'basetheme' ), + 'before_page_number' => '' . esc_attr__( 'Page', 'basetheme' ) . ' ', ) ); diff --git a/lib/theme-acfblocks.php b/lib/theme-acfblocks.php index 73c1d75..6f3907e 100644 --- a/lib/theme-acfblocks.php +++ b/lib/theme-acfblocks.php @@ -29,8 +29,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'buttongroup', - 'title' => __( 'Button Group' ), - 'description' => __( 'A group of Bootstrap-style buttons.' ), + 'title' => esc_attr__( 'Button Group', 'basetheme' ), + 'description' => esc_attr__( 'A group of Bootstrap-style buttons.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -43,8 +43,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'buttonbootstrap', - 'title' => __( 'Button (Bootstrap)' ), - 'description' => __( 'A bootstrap-style button.' ), + 'title' => esc_attr__( 'Button (Bootstrap)', 'basetheme' ), + 'description' => esc_attr__( 'A bootstrap-style button.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -64,8 +64,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'pageheader', - 'title' => __( 'Page Header' ), - 'description' => __( 'A page header with an image and content.' ), + 'title' => esc_attr__( 'Page Header', 'basetheme' ), + 'description' => esc_attr__( 'A page header with an image and content.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -80,8 +80,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'carddeck', - 'title' => __( 'Card Deck' ), - 'description' => __( 'A Bootstrap card deck.' ), + 'title' => esc_attr__( 'Card Deck', 'basetheme' ), + 'description' => esc_attr__( 'A Bootstrap card deck.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -94,8 +94,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'imageadvanced', - 'title' => __( 'Image (Advanced)' ), - 'description' => __( 'An advanced image field. Use if you need specifically styled images or additional HTML with an image.' ), + 'title' => esc_attr__( 'Image (Advanced)', 'basetheme' ), + 'description' => esc_attr__( 'An advanced image field. Use if you need specifically styled images or additional HTML with an image.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -108,8 +108,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'accordion', - 'title' => __( 'Accordion' ), - 'description' => __( 'A set of accordions.' ), + 'title' => esc_attr__( 'Accordion', 'basetheme' ), + 'description' => esc_attr__( 'A set of accordions.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -122,8 +122,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'slider', - 'title' => __( 'Slider' ), - 'description' => __( 'A slider block.' ), + 'title' => esc_attr__( 'Slider', 'basetheme' ), + 'description' => esc_attr__( 'A slider block.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -139,8 +139,8 @@ function bt_acf_register_blocks() { acf_register_block_type( array( 'name' => 'relatedposts', - 'title' => __( 'Related Posts' ), - 'description' => __( 'Display posts related to the current post\'s categories and/or tags.' ), + 'title' => esc_attr__( 'Related Posts', 'basetheme' ), + 'description' => esc_attr__( 'Display posts related to the current post\'s categories and/or tags.', 'basetheme' ), 'render_callback' => 'bt_acf_block_render_callback', 'category' => BT_ACF_BLOCKS_CATEGORY, 'icon' => $icon, @@ -176,7 +176,7 @@ function bt_register_block_categories( $categories, $post ) { array( array( 'slug' => BT_ACF_BLOCKS_CATEGORY, - 'title' => __( 'Basetheme Blocks', 'basetheme' ), + 'title' => esc_attr__( 'Basetheme Blocks', 'basetheme' ), ), ), $categories diff --git a/lib/theme-functions.php b/lib/theme-functions.php index b9f4a0e..85e9e0f 100755 --- a/lib/theme-functions.php +++ b/lib/theme-functions.php @@ -61,27 +61,27 @@ function bt_editor_add_theme_support() { 'editor-font-sizes', array( array( - 'name' => __( 'Small', 'basetheme' ), + 'name' => esc_attr__( 'Small', 'basetheme' ), 'size' => 12, 'slug' => 'small', ), array( - 'name' => __( 'Normal', 'basetheme' ), + 'name' => esc_attr__( 'Normal', 'basetheme' ), 'size' => 16, 'slug' => 'normal', ), array( - 'name' => __( 'Medium', 'basetheme' ), + 'name' => esc_attr__( 'Medium', 'basetheme' ), 'size' => 20, 'slug' => 'medium', ), array( - 'name' => __( 'Large', 'basetheme' ), + 'name' => esc_attr__( 'Large', 'basetheme' ), 'size' => 36, 'slug' => 'large', ), array( - 'name' => __( 'Huge', 'basetheme' ), + 'name' => esc_attr__( 'Huge', 'basetheme' ), 'size' => 48, 'slug' => 'huge', ), diff --git a/lib/theme-helpers.php b/lib/theme-helpers.php index 40896ca..9a30974 100755 --- a/lib/theme-helpers.php +++ b/lib/theme-helpers.php @@ -254,7 +254,7 @@ function bt_custom_oembed_filter( $html ) { * Returns a "Continue Reading" link. */ function boilerplate_continue_reading_link() { - return ' ' . __( 'Continue reading ', 'basetheme' ) . ''; + return ' ' . esc_attr__( 'Continue reading ', 'basetheme' ) . ''; } } diff --git a/lib/theme-setup.php b/lib/theme-setup.php index d6debe7..1eab9d4 100755 --- a/lib/theme-setup.php +++ b/lib/theme-setup.php @@ -58,9 +58,9 @@ function bt_setup() { */ register_nav_menus( array( - 'site-header-utility-nav' => __( 'Utility Navigation', 'basetheme' ), - 'site-header-main-nav' => __( 'Main Navigation', 'basetheme' ), - 'site-footer-main-nav' => __( 'Footer Navigation', 'basetheme' ), + 'site-header-utility-nav' => esc_attr__( 'Utility Navigation', 'basetheme' ), + 'site-header-main-nav' => esc_attr__( 'Main Navigation', 'basetheme' ), + 'site-footer-main-nav' => esc_attr__( 'Footer Navigation', 'basetheme' ), ) ); @@ -103,9 +103,9 @@ function bt_setup() { function bt_widgets_init() { register_sidebar( array( - 'name' => __( 'Blog Sidebar Widget Area', 'basetheme' ), + 'name' => esc_attr__( 'Blog Sidebar Widget Area', 'basetheme' ), 'id' => 'blog-sidebar-widget-area', - 'description' => __( 'The blog widget area', 'basetheme' ), + 'description' => esc_attr__( 'The blog widget area', 'basetheme' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', @@ -114,9 +114,9 @@ function bt_widgets_init() { ); register_sidebar( array( - 'name' => __( 'Page Sidebar Widget Area', 'basetheme' ), + 'name' => esc_attr__( 'Page Sidebar Widget Area', 'basetheme' ), 'id' => 'page-sidebar-widget-area', - 'description' => __( 'The page widget area', 'basetheme' ), + 'description' => esc_attr__( 'The page widget area', 'basetheme' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', diff --git a/search.php b/search.php index eddfdc4..b713edd 100755 --- a/search.php +++ b/search.php @@ -37,9 +37,9 @@ // Previous/next page navigation. the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'basetheme' ), - 'next_text' => __( 'Next page', 'basetheme' ), - 'before_page_number' => '' . __( 'Page', 'basetheme' ) . ' ', + 'prev_text' => esc_attr__( 'Previous page', 'basetheme' ), + 'next_text' => esc_attr__( 'Next page', 'basetheme' ), + 'before_page_number' => '' . esc_attr__( 'Page', 'basetheme' ) . ' ', ) ); diff --git a/single.php b/single.php index 9b4ff3d..6fd4bd8 100755 --- a/single.php +++ b/single.php @@ -35,11 +35,11 @@ // Previous/next post navigation. the_post_navigation( array( - 'next_text' => ' ' . - '' . __( 'Next post:', 'basetheme' ) . ' ' . + 'next_text' => ' ' . + '' . esc_attr__( 'Next post:', 'basetheme' ) . ' ' . '%title', - 'prev_text' => ' ' . - '' . __( 'Previous post:', 'basetheme' ) . ' ' . + 'prev_text' => ' ' . + '' . esc_attr__( 'Previous post:', 'basetheme' ) . ' ' . '%title', ) );