PHP Classes

File: includes/compatibility.php

Recommend this page to a friend!
  Classes of Marco Cesarato   PHP API Database   includes/compatibility.php   Download  
File: includes/compatibility.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP API Database
Provide access to database records via REST API
Author: By
Last change: Reformatted code (php-cs-fixer)

Added code standard,
Added hooks git for code standard,
Fixed parse where on null elements
Date: 3 years ago
Size: 1,359 bytes


Class file image Download
 * Compatibility.
 * @author Marco Cesarato <>
 * @license GNU Public License
 * @see
if (!function_exists('shortcode_atts')) {
     * Combine user attributes with known attributes and fill in defaults when needed.
     * The pairs should be considered to be all of the attributes which are
     * supported by the caller and given as a list. The returned attributes will
     * only contain the attributes in the $pairs list.
     * If the $atts list has unsupported attributes, then they will be ignored and
     * removed from the final returned list.
     * @from Wordpress
     * @param array $pairs entire list of supported attributes and their defaults
     * @param array $atts user defined attributes in shortcode tag
     * @return array combined and filtered attribute list
     * @since 2.5
function shortcode_atts($pairs, $atts)
$atts = (array)$atts;
$out = [];
        foreach (
$pairs as $name => $default) {
            if (
array_key_exists($name, $atts)) {
$out[$name] = $atts[$name];
            } else {
$out[$name] = $default;