forked from lino/radar-wp
Remove some PHP notices.
This commit is contained in:
parent
a18397d3e3
commit
def076a641
2 changed files with 5 additions and 1 deletions
|
@ -72,8 +72,10 @@ function radar_filter($settings) {
|
||||||
* Collapses subfields, simplifies field list.
|
* Collapses subfields, simplifies field list.
|
||||||
*/
|
*/
|
||||||
function _radar_field_collect_subfields(&$fields) {
|
function _radar_field_collect_subfields(&$fields) {
|
||||||
|
$entity_fields = array();
|
||||||
|
|
||||||
foreach ($fields as $delta => $listed_field) {
|
foreach ($fields as $delta => $listed_field) {
|
||||||
list($field, $subfield) = explode(':', $listed_field, 2);
|
list($field, $subfield) = array_pad(explode(':', $listed_field, 2), 2, null);
|
||||||
if (!empty($subfield)) {
|
if (!empty($subfield)) {
|
||||||
// A field with subfields.
|
// A field with subfields.
|
||||||
if (!empty($entity_fields[$field])) {
|
if (!empty($entity_fields[$field])) {
|
||||||
|
|
|
@ -326,6 +326,8 @@ add_filter('shortcode_atts_radar_events', 'radar_shortcode_parse', 10, 3);
|
||||||
* Format item's parsed fields array for radar shortcode's.
|
* Format item's parsed fields array for radar shortcode's.
|
||||||
*/
|
*/
|
||||||
function radar_format_item($type, $item, $shortcode, $parents = array()) {
|
function radar_format_item($type, $item, $shortcode, $parents = array()) {
|
||||||
|
$content = '';
|
||||||
|
|
||||||
foreach ($item as $field) {
|
foreach ($item as $field) {
|
||||||
// Item containing other items.
|
// Item containing other items.
|
||||||
if (!empty($field['entity'])) {
|
if (!empty($field['entity'])) {
|
||||||
|
|
Loading…
Reference in a new issue