| @@ 470-488 (lines=19) @@ | ||
| 467 | } |
|
| 468 | } |
|
| 469 | ||
| 470 | if ( $atts['orderby'] ) { |
|
| 471 | $atts['orderby'] = urldecode( $atts['orderby'] ); |
|
| 472 | $atts['orderby'] = strtolower( $atts['orderby'] ); |
|
| 473 | $allowed_keys = array( 'author', 'date', 'title', 'rand' ); |
|
| 474 | ||
| 475 | $parsed = array(); |
|
| 476 | foreach ( explode( ',', $atts['orderby'] ) as $portfolio_index_number => $orderby ) { |
|
| 477 | if ( ! in_array( $orderby, $allowed_keys ) ) { |
|
| 478 | continue; |
|
| 479 | } |
|
| 480 | $parsed[] = $orderby; |
|
| 481 | } |
|
| 482 | ||
| 483 | if ( empty( $parsed ) ) { |
|
| 484 | unset( $atts['orderby'] ); |
|
| 485 | } else { |
|
| 486 | $atts['orderby'] = implode( ' ', $parsed ); |
|
| 487 | } |
|
| 488 | } |
|
| 489 | ||
| 490 | // enqueue shortcode styles when shortcode is used |
|
| 491 | wp_enqueue_style( 'jetpack-portfolio-style', plugins_url( 'css/portfolio-shortcode.css', __FILE__ ), array(), '20140326' ); |
|
| @@ 558-576 (lines=19) @@ | ||
| 555 | } |
|
| 556 | } |
|
| 557 | ||
| 558 | if ( $atts['orderby'] ) { |
|
| 559 | $atts['orderby'] = urldecode( $atts['orderby'] ); |
|
| 560 | $atts['orderby'] = strtolower( $atts['orderby'] ); |
|
| 561 | $allowed_keys = array('author', 'date', 'title', 'rand'); |
|
| 562 | ||
| 563 | $parsed = array(); |
|
| 564 | foreach ( explode( ',', $atts['orderby'] ) as $testimonial_index_number => $orderby ) { |
|
| 565 | if ( ! in_array( $orderby, $allowed_keys ) ) { |
|
| 566 | continue; |
|
| 567 | } |
|
| 568 | $parsed[] = $orderby; |
|
| 569 | } |
|
| 570 | ||
| 571 | if ( empty( $parsed ) ) { |
|
| 572 | unset($atts['orderby']); |
|
| 573 | } else { |
|
| 574 | $atts['orderby'] = implode( ' ', $parsed ); |
|
| 575 | } |
|
| 576 | } |
|
| 577 | ||
| 578 | // enqueue shortcode styles when shortcode is used |
|
| 579 | wp_enqueue_style( 'jetpack-testimonial-style', plugins_url( 'css/testimonial-shortcode.css', __FILE__ ), array(), '20140326' ); |
|