本文整理汇总了PHP中Social::broadcasting_available_post_types方法的典型用法代码示例。如果您正苦于以下问题:PHP Social::broadcasting_available_post_types方法的具体用法?PHP Social::broadcasting_available_post_types怎么用?PHP Social::broadcasting_available_post_types使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Social
的用法示例。
在下文中一共展示了Social::broadcasting_available_post_types方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: broadcasting_enabled_post_types
/**
* Return array of enabled social broadcasting post types
*
* @static
* @return array
*/
public static function broadcasting_enabled_post_types()
{
$available = Social::broadcasting_available_post_types();
$enabled = Social::option('enabled_post_types');
if (!$enabled) {
$default = get_post_types(array('hierarchical' => false));
$enabled = array_keys($default);
}
return apply_filters('social_broadcasting_enabled_post_types', array_intersect($available, $enabled));
}
示例2: compact
?>
</p>
</th>
<td>
<?php
echo Social_View::factory('wp-admin/parts/accounts', compact('services', 'accounts', 'defaults'));
?>
</td>
</tr>
<tr>
<th><?php
_e('Broadcasting enabled for', 'social');
?>
</th>
<?php
$available_post_types = Social::broadcasting_available_post_types();
$enabled_post_types = Social::broadcasting_enabled_post_types();
?>
<td>
<?php
foreach ($available_post_types as $type) {
?>
<div>
<input type="checkbox" id="social_enabled_post_types[<?php
echo esc_attr($type);
?>
]" name="social_enabled_post_types[<?php
echo esc_attr($type);
?>
]" value="1" <?php
echo checked(in_array($type, $enabled_post_types));