wp/wp-includes/class-wp-metadata-lazyloader.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    72 	 * @param array  $object_ids  Array of object IDs.
    72 	 * @param array  $object_ids  Array of object IDs.
    73 	 * @return bool|WP_Error True on success, WP_Error on failure.
    73 	 * @return bool|WP_Error True on success, WP_Error on failure.
    74 	 */
    74 	 */
    75 	public function queue_objects( $object_type, $object_ids ) {
    75 	public function queue_objects( $object_type, $object_ids ) {
    76 		if ( ! isset( $this->settings[ $object_type ] ) ) {
    76 		if ( ! isset( $this->settings[ $object_type ] ) ) {
    77 			return new WP_Error( 'invalid_object_type', __( 'Invalid object type' ) );
    77 			return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );
    78 		}
    78 		}
    79 
    79 
    80 		$type_settings = $this->settings[ $object_type ];
    80 		$type_settings = $this->settings[ $object_type ];
    81 
    81 
    82 		if ( ! isset( $this->pending_objects[ $object_type ] ) ) {
    82 		if ( ! isset( $this->pending_objects[ $object_type ] ) ) {
   112 	 * @param string $object_type Object type. Accepts 'comment' or 'term'.
   112 	 * @param string $object_type Object type. Accepts 'comment' or 'term'.
   113 	 * @return bool|WP_Error True on success, WP_Error on failure.
   113 	 * @return bool|WP_Error True on success, WP_Error on failure.
   114 	 */
   114 	 */
   115 	public function reset_queue( $object_type ) {
   115 	public function reset_queue( $object_type ) {
   116 		if ( ! isset( $this->settings[ $object_type ] ) ) {
   116 		if ( ! isset( $this->settings[ $object_type ] ) ) {
   117 			return new WP_Error( 'invalid_object_type', __( 'Invalid object type' ) );
   117 			return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );
   118 		}
   118 		}
   119 
   119 
   120 		$type_settings = $this->settings[ $object_type ];
   120 		$type_settings = $this->settings[ $object_type ];
   121 
   121 
   122 		$this->pending_objects[ $object_type ] = array();
   122 		$this->pending_objects[ $object_type ] = array();