Skip to content

Commit

Permalink
update svg function throughout theme
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrickaby committed Jul 21, 2017
1 parent da55709 commit 11f608d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions assets/images/svg-icons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All of the starter SVG icons included in this repo are from [IcoMoon App](https:

### Inline SVG helper functions

[`_s_get_svg( $args = array() ); // Return SVG markup`](../../blob/master/inc/template-tags.php#L125)
[`_s_display_svg( $args = array() ); // Return SVG markup`](../../blob/master/inc/template-tags.php#L125)
```
/**
* Return SVG markup.
Expand All @@ -26,7 +26,7 @@ All of the starter SVG icons included in this repo are from [IcoMoon App](https:
```

Example usage:
`<?php echo _s_get_svg( array( 'icon' => 'twitter' ) ); ?>`
`<?php echo _s_display_svg( array( 'icon' => 'twitter' ) ); ?>`

Output:
```
Expand Down
6 changes: 3 additions & 3 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ function _s_get_the_title( $args = array() ) {

// Set defaults.
$defaults = array(
'length' => 12,
'more' => '...',
'length' => 12,
'more' => '...',
);

// Parse args.
Expand Down Expand Up @@ -333,7 +333,7 @@ function _s_display_social_network_links() {
if ( ! empty( $network_url ) ) : ?>
<li class="social-icon <?php echo esc_attr( $network ); ?>">
<a href="<?php echo esc_url( $network_url ); ?>">
<?php echo _s_get_svg( array( // WPCS: XSS ok.
<?php _s_display_svg( array(
'icon' => $network . '-square',
'title' => /* translators: the social network name */ sprintf( esc_html_e( 'Link to %s', '_s' ), ucwords( esc_html( $network ) ) ),
) ); ?>
Expand Down
4 changes: 2 additions & 2 deletions template-parts/scaffolding/scaffolding-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
_s_display_scaffolding_section( array(
'title' => 'SVG',
'description' => 'Display inline SVGs.',
'usage' => '<?php _s_get_svg( array( \'icon\' => \'facebook-square\' ) ); ?>',
'usage' => '<?php _s_display_svg( array( \'icon\' => \'facebook-square\' ) ); ?>',
'parameters' => array(
'$args' => '(required) Configuration arguments.',
),
Expand All @@ -23,6 +23,6 @@
'title' => '(optional) The title of the icon. Default: none',
'desc' => '(optional) The description of the icon. Default: none',
),
'output' => _s_get_svg( array( 'icon' => 'facebook-square' ) ),
'output' => _s_display_svg( array( 'icon' => 'facebook-square' ) ),
) ); ?>
</section>
6 changes: 3 additions & 3 deletions template-parts/sharing-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ul class="social-icons menu menu-horizontal">
<li class="social-icon">
<a href="<?php echo esc_url( _s_get_twitter_share_url() ); ?>" onclick="window.open(this.href, 'targetWindow', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, top=150, left=0, width=600, height=300' ); return false;">
<?php echo _s_get_svg( array( // WPCS: XSS ok.
<?php _s_display_svg( array(
'icon' => 'twitter-square',
'title' => 'Twitter',
'desc' => esc_html__( 'Share on Twitter', '_s' ),
Expand All @@ -22,7 +22,7 @@
</li>
<li class="social-icon">
<a href="<?php echo esc_url( _s_get_facebook_share_url() ); ?>" onclick="window.open(this.href, 'targetWindow', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, top=150, left=0, width=600, height=300' ); return false;">
<?php echo _s_get_svg( array( // WPCS: XSS ok.
<?php _s_display_svg( array(
'icon' => 'facebook-square',
'title' => 'Facebook',
'desc' => esc_html__( 'Share on Facebook', '_s' ),
Expand All @@ -32,7 +32,7 @@
</li>
<li class="social-icon">
<a href="<?php echo esc_url( _s_get_linkedin_share_url() ); ?>" onclick="window.open(this.href, 'targetWindow', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, top=150, left=0, width=475, height=505' ); return false;">
<?php echo _s_get_svg( array( // WPCS: XSS ok.
<?php _s_display_svg( array(
'icon' => 'linkedin-square',
'title' => 'LinkedIn',
'desc' => esc_html__( 'Share on LinkedIn', '_s' ),
Expand Down

0 comments on commit 11f608d

Please sign in to comment.