我对WordPress很陌生,我想按性别筛选一个列表。
选择男性选项应过滤列表,以仅显示具有相关信息的男性。
我如何才能做到这一点?
$list = array(
(object) array( \'name\' => \'John\', \'gender\' => \'male\', \'job\' => \'Farmer\' ),
(object) array( \'name\' => \'Paul\', \'gender\' => \'male\', \'job\' => \'Blacksmith\' ),
(object) array( \'name\' => \'Adam\', \'gender\' => \'male\', \'job\' => \'\' ),
(object) array( \'name\' => \'Mike\', \'gender\' => \'male\', \'job\' => \'\' ),
(object) array( \'name\' => \'Jane\', \'gender\' => \'female\', \'job\' => \'Baker\' ),
(object) array( \'name\' => \'Jill\', \'gender\' => \'female\', \'job\' => \'Farmer\' ),
);