Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/28/2024 10:25:38 PM (2 years ago)
Author:
imath
Message:

BP Nouveau: improve PHP code standards using WPCS

See #7228 (branch 12.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/12.0/src/bp-activity/bp-activity-template.php

    r13817 r13821  
    13001300
    13011301/**
     1302 * Returns the Allowed HTML tags for the activity action.
     1303 *
     1304 * @since 12.4.1
     1305 *
     1306 * @return array The Allowed HTML tags for the activity action.
     1307 */
     1308function bp_activity_action_allowed_html() {
     1309        return array(
     1310                'p'    => true,
     1311                'a'    => array(
     1312                        'href'            => true,
     1313                        'class'           => true,
     1314                        'data-bp-tooltip' => true,
     1315                ),
     1316                'span' => array(
     1317                        'class'          => true,
     1318                        'data-livestamp' => true,
     1319                ),
     1320                'img'  => array(
     1321                        'src'     => true,
     1322                        'loading' => true,
     1323                        'class'   => true,
     1324                        'alt'     => true,
     1325                        'height'  => true,
     1326                        'width'   => true,
     1327                ),
     1328        );
     1329}
     1330
     1331/**
     1332 * Output Activity metadata.
     1333 *
     1334 * @since 12.4.1
     1335 */
     1336function bp_output_activity_meta( $content = '' ) {
     1337        echo wp_kses( bp_insert_activity_meta( $content ), bp_activity_action_allowed_html() );
     1338}
     1339
     1340/**
    13021341 * Output the activity action.
    13031342 *
     
    13071346 */
    13081347function bp_activity_action( $args = array() ) {
    1309         echo wp_kses(
    1310                 bp_get_activity_action( $args ),
    1311                 array(
    1312                         'p'    => true,
    1313                         'a'    => array(
    1314                                 'href'            => true,
    1315                                 'class'           => true,
    1316                                 'data-bp-tooltip' => true,
    1317                         ),
    1318                         'span' => array(
    1319                                 'class' => true,
    1320                         ),
    1321                         'img'  => array(
    1322                                 'src'     => true,
    1323                                 'loading' => true,
    1324                                 'class'   => true,
    1325                                 'alt'     => true,
    1326                                 'height'  => true,
    1327                                 'width'   => true,
    1328                         ),
    1329                 )
    1330         );
     1348        echo wp_kses( bp_get_activity_action( $args ), bp_activity_action_allowed_html() );
    13311349}
    13321350
Note: See TracChangeset for help on using the changeset viewer.