Пример #1
0
 /**
  * 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
0
?>
</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));