Skip to content

Commit 669269e

Browse files
author
tobiasz.cudnik
committed
task 57: ->remove($selector) doesn't respect $selector
http://code.google.com/p/phpquery/issues/detail?id=57 git-svn-id: http://phpquery.googlecode.com/svn/branches/dev@201 afc5ee8f-4a33-0410-9214-8715c29b7d85
1 parent 728ab38 commit 669269e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

phpQuery/phpQuery.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,8 +2616,11 @@ public function replaceAll($selector) {
26162616
*
26172617
* @return phpQueryObject|queryTemplatesFetch|queryTemplatesParse|queryTemplatesPickup
26182618
*/
2619-
public function remove() {
2620-
foreach( $this->elements as $node ) {
2619+
public function remove($selector = null) {
2620+
$loop = $selector
2621+
? $this->filter($selector)->elements
2622+
: $this->elements;
2623+
foreach($loop as $node) {
26212624
if (! $node->parentNode )
26222625
continue;
26232626
$this->debug("Removing '{$node->tagName}'");

0 commit comments

Comments
 (0)