Changeset 31312 for trunk/src/wp-includes/meta.php
- Timestamp:
- 01/31/2015 03:47:51 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r31212 r31312 935 935 936 936 /** 937 * A flat list of clauses, keyed by clause 'name'. 938 * 939 * @since 4.2.0 940 * @var array 941 */ 942 protected $clauses = array(); 943 944 /** 937 945 * Constructor. 938 946 * 939 947 * @since 3.2.0 948 * @since 4.2.0 Introduced the `$name` parameter, for improved `$orderby` support in the parent query. 949 * 940 950 * @access public 941 951 * … … 958 968 * 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', or 'UNSIGNED'. 959 969 * Default is 'CHAR'. 970 * @type string $name Optional. A unique identifier for the clause. If provided, `$name` can be 971 * referenced in the `$orderby` parameter of the parent query. 960 972 * } 961 973 * } … … 1375 1387 $clause['alias'] = $alias; 1376 1388 1389 // Determine the data type. 1390 $_meta_type = isset( $clause['type'] ) ? $clause['type'] : ''; 1391 $meta_type = $this->get_cast_for_type( $_meta_type ); 1392 $clause['cast'] = $meta_type; 1393 1394 // Store the clause in our flat array. 1395 $clause_name = isset( $clause['name'] ) ? $clause['name'] : $clause['alias']; 1396 $this->clauses[ $clause_name ] =& $clause; 1397 1377 1398 // Next, build the WHERE clause. 1378 1399 … … 1389 1410 if ( array_key_exists( 'value', $clause ) ) { 1390 1411 $meta_value = $clause['value']; 1391 $meta_type = $this->get_cast_for_type( isset( $clause['type'] ) ? $clause['type'] : '' );1392 1412 1393 1413 if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) { … … 1449 1469 1450 1470 return $sql_chunks; 1471 } 1472 1473 /** 1474 * Get a flattened list of sanitized meta clauses, indexed by clause 'name'. 1475 * 1476 * This array should be used for clause lookup, as when the table alias and CAST type must be determined for 1477 * a value of 'orderby' corresponding to a meta clause. 1478 * 1479 * @since 4.2.0 1480 * @access public 1481 * 1482 * @return array 1483 */ 1484 public function get_clauses() { 1485 return $this->clauses; 1451 1486 } 1452 1487
Note: See TracChangeset
for help on using the changeset viewer.