summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2019-01-01 22:18:11 -0500
committerAnthony G. Basile <blueness@gentoo.org>2019-01-01 22:18:11 -0500
commit018bd442ec1e04ba78a6628763414eb60b359398 (patch)
tree448cde462397af33e5a964ba5d0803b73c65040e /plugins/jetpack/modules/shortcodes/quiz.php
parentUpdate easy-table 1.8 (diff)
downloadblogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.tar.gz
blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.tar.bz2
blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.zip
Update jetpack 6.8.1
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/shortcodes/quiz.php')
-rw-r--r--plugins/jetpack/modules/shortcodes/quiz.php38
1 files changed, 23 insertions, 15 deletions
diff --git a/plugins/jetpack/modules/shortcodes/quiz.php b/plugins/jetpack/modules/shortcodes/quiz.php
index 063f9a42..1abfdd54 100644
--- a/plugins/jetpack/modules/shortcodes/quiz.php
+++ b/plugins/jetpack/modules/shortcodes/quiz.php
@@ -165,24 +165,23 @@ class Quiz_Shortcode {
$default_atts = self::is_wpcom()
? array(
- 'trackid' => '',
+ 'trackid' => '',
'a8ctraining' => '',
)
: array(
'trackid' => '',
);
-
self::$quiz_params = shortcode_atts( $default_atts, $atts );
- if ( ! empty( self::$quiz_params[ 'trackid' ] ) ) {
- $id .= ' data-trackid="' . esc_attr( self::$quiz_params[ 'trackid' ] ) . '"';
+ if ( ! empty( self::$quiz_params['trackid'] ) ) {
+ $id .= ' data-trackid="' . esc_attr( self::$quiz_params['trackid'] ) . '"';
}
- if ( self::is_wpcom() && ! empty( self::$quiz_params[ 'a8ctraining' ] ) ) {
+ if ( self::is_wpcom() && ! empty( self::$quiz_params['a8ctraining'] ) ) {
if ( is_null( self::$username ) ) {
self::$username = wp_get_current_user()->user_login;
}
- $id .= ' data-a8ctraining="'. esc_attr( self::$quiz_params[ 'a8ctraining' ] ) . '" data-username="' . esc_attr( self::$username ) . '"';
+ $id .= ' data-a8ctraining="' . esc_attr( self::$quiz_params['a8ctraining'] ) . '" data-username="' . esc_attr( self::$username ) . '"';
}
}
@@ -206,15 +205,24 @@ class Quiz_Shortcode {
// Add internal parameter so it's only rendered when it has it
$content = preg_replace( '/\[(question|answer|wrong|explanation)\]/i', '[$1 quiz_item="true"]', $content );
$content = do_shortcode( $content );
- $content = wp_kses( $content, array(
- 'tt' => array(),
- 'pre' => array(),
- 'strong' => array(),
- 'i' => array(),
- 'br' => array(),
- 'img' => array( 'src' => true),
- 'div' => array( 'class' => true, 'data-correct' => 1, 'data-track-id' => 1, 'data-a8ctraining' => 1, 'data-username' => 1 ),
- ) );
+ $content = wp_kses(
+ $content,
+ array(
+ 'tt' => array(),
+ 'pre' => array(),
+ 'strong' => array(),
+ 'i' => array(),
+ 'br' => array(),
+ 'img' => array( 'src' => true ),
+ 'div' => array(
+ 'class' => true,
+ 'data-correct' => 1,
+ 'data-track-id' => 1,
+ 'data-a8ctraining' => 1,
+ 'data-username' => 1,
+ ),
+ )
+ );
return $content;
}