| @@ 1396-1411 (lines=16) @@ | ||
| 1393 | * @version 2.0 |
|
| 1394 | */ |
|
| 1395 | function pods_str_replace ( $find, $replace, $string, $occurrences = -1 ) { |
|
| 1396 | if ( is_array( $string ) ) { |
|
| 1397 | foreach ( $string as $k => $v ) { |
|
| 1398 | $string[ $k ] = pods_str_replace( $find, $replace, $v, $occurrences ); |
|
| 1399 | } |
|
| 1400 | ||
| 1401 | return $string; |
|
| 1402 | } |
|
| 1403 | elseif ( is_object( $string ) ) { |
|
| 1404 | $string = get_object_vars( $string ); |
|
| 1405 | ||
| 1406 | foreach ( $string as $k => $v ) { |
|
| 1407 | $string[ $k ] = pods_str_replace( $find, $replace, $v, $occurrences ); |
|
| 1408 | } |
|
| 1409 | ||
| 1410 | return (object) $string; |
|
| 1411 | } |
|
| 1412 | ||
| 1413 | if ( is_array( $find ) ) { |
|
| 1414 | foreach ( $find as &$f ) { |
|
| @@ 1479-1496 (lines=18) @@ | ||
| 1476 | */ |
|
| 1477 | function pods_evaluate_tags ( $tags, $sanitize = false ) { |
|
| 1478 | ||
| 1479 | if ( is_array( $tags ) ) { |
|
| 1480 | foreach ( $tags as $k => $tag ) { |
|
| 1481 | $tags[ $k ] = pods_evaluate_tags( $tag, $sanitize ); |
|
| 1482 | } |
|
| 1483 | ||
| 1484 | return $tags; |
|
| 1485 | } |
|
| 1486 | elseif ( is_object( $tags ) ) { |
|
| 1487 | $tags = get_object_vars( $tags ); |
|
| 1488 | ||
| 1489 | foreach ( $tags as $k => $tag ) { |
|
| 1490 | $tags[ $k ] = pods_evaluate_tags( $tag, $sanitize ); |
|
| 1491 | } |
|
| 1492 | ||
| 1493 | $tags = (object) $tags; |
|
| 1494 | ||
| 1495 | return $tags; |
|
| 1496 | } |
|
| 1497 | ||
| 1498 | $callback = 'pods_evaluate_tag'; |
|
| 1499 | ||