xfn_check [ WordPress Function ]
xfn_check ( $class, $value = '', $deprecated = '' )
| Parameters: |
|
| Defined at: |
|
Display checked checkboxes attribute for xfn microformat options.
Source
<?php
function xfn_check( $class, $value = '', $deprecated = '' ) {
global $link;
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
$rels = preg_split('/\s+/', $link_rel);
if ('' != $value && in_array($value, $rels) ) {
echo ' checked="checked"';
}
if ('' == $value) {
if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- <?php if ( ! empty($link_id) ) { $editing = true; $heading = __('Edit a ...
</th> <td> <label for="me"> <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> /> <?php _e('another web address ...
core.svn.wordpress.org - PHPXRef 0.7 : WordPress : Detail view of meta-boxes.php
xfn_check() link_xfn_meta_box() link_advanced_meta_box() ...
phpxref.ftwr.co.uk - theme development - How to add an option for "nofollow" to the Link ...
Dec 10, 2010 ... </span></legend> <label for="me"> <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> /> <?php ...
wordpress.stackexchange.com - meta-boxes.php - PHP Cross Reference of WordPress Source - Yoast
xfn_check() link_xfn_meta_box() link_advanced_meta_box() ...
xref.yoast.com