public function collection_shortcode($atts, $content = null) { $atts = shortcode_atts(array("id" => 0, "name" => '', "nocache" => false, "mode" => "normal"), $atts); $id = intval($atts["id"]); $name = sanitize_text_field($atts["name"]); if ($id > 0) { $collection = maxCollections::getCollectionByID($id); } elseif ($atts["name"] != '') { $collection = maxCollections::getCollectionByName($name); } if ($collection) { return $collection->shortcode($atts, $content); } }