array(), ); $allowed_tags['a']['class'] = array(); if ( ! $svg ) { return $allowed_tags; } $allowed_tags['svg'] = array( 'xmlns' => array(), 'fill' => array(), 'viewbox' => array(), 'role' => array(), 'aria-hidden' => array(), 'focusable' => array(), 'class' => array(), ); $allowed_tags['path'] = array( 'd' => array(), 'fill' => array(), 'opacity' => array(), ); $allowed_tags['g'] = array(); $allowed_tags['use'] = array( 'xlink:href' => array(), ); $allowed_tags['symbol'] = array( 'aria-hidden' => array(), 'viewBox' => array(), 'id' => array(), 'xmls' => array(), ); return $allowed_tags; } /** * Get the plugin directory for a path. * * @param string $path The path to the file. * * @return string The new path. */ public static function get_plugin_dir( $path = '' ) { $dir = rtrim( plugin_dir_path( ALERTS_DLX_FILE ), '/' ); if ( ! empty( $path ) && is_string( $path ) ) { $dir .= '/' . ltrim( $path, '/' ); } return $dir; } /** * Return a plugin URL path. * * @param string $path Path to the file. * * @return string URL to to the file. */ public static function get_plugin_url( $path = '' ) { $dir = rtrim( plugin_dir_url( ALERTS_DLX_FILE ), '/' ); if ( ! empty( $path ) && is_string( $path ) ) { $dir .= '/' . ltrim( $path, '/' ); } return $dir; } /** * Gets the highest priority for a filter. * * @param int $subtract The amount to subtract from the high priority. * * @return int priority. */ public static function get_highest_priority( $subtract = 0 ) { $highest_priority = PHP_INT_MAX; $subtract = absint( $subtract ); if ( 0 === $subtract ) { --$highest_priority; } else { $highest_priority = absint( $highest_priority - $subtract ); } return $highest_priority; } }