| @@ 1042-1052 (lines=11) @@ | ||
| 1039 | ||
| 1040 | add_shortcode( 'jetpack_subscription_form', 'jetpack_do_subscription_form' ); |
|
| 1041 | ||
| 1042 | function jetpack_do_subscription_form( $instance ) { |
|
| 1043 | $instance['show_subscribers_total'] = empty( $instance['show_subscribers_total'] ) ? false : true; |
|
| 1044 | $instance = shortcode_atts( Jetpack_Subscriptions_Widget::defaults(), $instance, 'jetpack_subscription_form' ); |
|
| 1045 | $args = array( |
|
| 1046 | 'before_widget' => sprintf( '<div class="%s">', 'jetpack_subscription_widget' ), |
|
| 1047 | ); |
|
| 1048 | ob_start(); |
|
| 1049 | the_widget( 'Jetpack_Subscriptions_Widget', $instance, $args ); |
|
| 1050 | $output = ob_get_clean(); |
|
| 1051 | return $output; |
|
| 1052 | } |
|
| 1053 | ||
| @@ 518-538 (lines=21) @@ | ||
| 515 | * |
|
| 516 | * @since 3.9.2 |
|
| 517 | */ |
|
| 518 | function jetpack_do_top_posts_widget( $instance ) { |
|
| 519 | // Post Types can't be entered as an array in the shortcode parameters. |
|
| 520 | $instance['types'] = implode( ',', $instance['types'] ); |
|
| 521 | ||
| 522 | $instance = shortcode_atts( |
|
| 523 | Jetpack_Top_Posts_Widget::defaults(), |
|
| 524 | $instance, |
|
| 525 | 'jetpack_top_posts_widget' |
|
| 526 | ); |
|
| 527 | ||
| 528 | // Add a class to allow styling |
|
| 529 | $args = array( |
|
| 530 | 'before_widget' => sprintf( '<div class="%s">', 'jetpack_top_posts_widget' ), |
|
| 531 | ); |
|
| 532 | ||
| 533 | ob_start(); |
|
| 534 | the_widget( 'Jetpack_Top_Posts_Widget', $instance, $args ); |
|
| 535 | $output = ob_get_clean(); |
|
| 536 | ||
| 537 | return $output; |
|
| 538 | } |
|
| 539 | add_shortcode( 'jetpack_top_posts_widget', 'jetpack_do_top_posts_widget' ); |
|
| 540 | ||