| @@ 548-566 (lines=19) @@ | ||
| 545 | } |
|
| 546 | } |
|
| 547 | ||
| 548 | if ( $atts['orderby'] ) { |
|
| 549 | $atts['orderby'] = urldecode( $atts['orderby'] ); |
|
| 550 | $atts['orderby'] = strtolower( $atts['orderby'] ); |
|
| 551 | $allowed_keys = array( 'author', 'date', 'title', 'rand' ); |
|
| 552 | ||
| 553 | $parsed = array(); |
|
| 554 | foreach ( explode( ',', $atts['orderby'] ) as $portfolio_index_number => $orderby ) { |
|
| 555 | if ( ! in_array( $orderby, $allowed_keys ) ) { |
|
| 556 | continue; |
|
| 557 | } |
|
| 558 | $parsed[] = $orderby; |
|
| 559 | } |
|
| 560 | ||
| 561 | if ( empty( $parsed ) ) { |
|
| 562 | unset( $atts['orderby'] ); |
|
| 563 | } else { |
|
| 564 | $atts['orderby'] = implode( ' ', $parsed ); |
|
| 565 | } |
|
| 566 | } |
|
| 567 | ||
| 568 | // enqueue shortcode styles when shortcode is used |
|
| 569 | wp_enqueue_style( 'jetpack-portfolio-style', plugins_url( 'css/portfolio-shortcode.css', __FILE__ ), array(), '20140326' ); |
|
| @@ 563-581 (lines=19) @@ | ||
| 560 | } |
|
| 561 | } |
|
| 562 | ||
| 563 | if ( $atts['orderby'] ) { |
|
| 564 | $atts['orderby'] = urldecode( $atts['orderby'] ); |
|
| 565 | $atts['orderby'] = strtolower( $atts['orderby'] ); |
|
| 566 | $allowed_keys = array('author', 'date', 'title', 'rand'); |
|
| 567 | ||
| 568 | $parsed = array(); |
|
| 569 | foreach ( explode( ',', $atts['orderby'] ) as $testimonial_index_number => $orderby ) { |
|
| 570 | if ( ! in_array( $orderby, $allowed_keys ) ) { |
|
| 571 | continue; |
|
| 572 | } |
|
| 573 | $parsed[] = $orderby; |
|
| 574 | } |
|
| 575 | ||
| 576 | if ( empty( $parsed ) ) { |
|
| 577 | unset($atts['orderby']); |
|
| 578 | } else { |
|
| 579 | $atts['orderby'] = implode( ' ', $parsed ); |
|
| 580 | } |
|
| 581 | } |
|
| 582 | ||
| 583 | // enqueue shortcode styles when shortcode is used |
|
| 584 | wp_enqueue_style( 'jetpack-testimonial-style', plugins_url( 'css/testimonial-shortcode.css', __FILE__ ), array(), '20140326' ); |
|