Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/07/2009, 13:48
DigitalUser
 
Fecha de Ingreso: abril-2007
Mensajes: 14
Antigüedad: 17 años, 1 mes
Puntos: 0
Que es lo que hace ->

Hola a todos.

Que es lo que hace ->

<?php checked($post->comment_status, 'open'); ?>

Por ejemplo:

Código PHP:
Ver original
  1. <?php
  2.  
  3. function checked( $checked, $current = true, $echo = true) {
  4.     return __checked_selected_helper( $checked, $current, $echo, 'checked' );
  5. }
  6.  
  7.  
  8. function __checked_selected_helper( $helper, $current, $echo, $type) {
  9.     if ( $helper == $current)
  10.         $result = " $type='$type'";
  11.     else
  12.         $result = '';
  13.  
  14.     if ($echo)
  15.         echo $result;
  16.  
  17.     return $result;
  18. }
  19.  
  20. checked($post->comment_status, 'open');  
  21.  
  22. ?>

El resultado retornado es:

Código HTML:
Ver original
  1. type="checkbox"


un saludo

Última edición por DigitalUser; 05/07/2009 a las 14:12