plugin update (wp-media-folder)
This commit is contained in:
@@ -2297,4 +2297,24 @@ class WpmfHelper
|
||||
return 'application/octet-stream';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check is folder active for post type
|
||||
*
|
||||
* @param string $post_type Post type name
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isForThisPostType($post_type)
|
||||
{
|
||||
$settings = get_option('wpmf_settings');
|
||||
if (isset($settings) && isset($settings['wpmf_active_folders_post_types'])) {
|
||||
$post_types = $settings['wpmf_active_folders_post_types'];
|
||||
$post_types = is_array($post_types) ? $post_types : [];
|
||||
} else {
|
||||
$post_types = array();
|
||||
}
|
||||
|
||||
return in_array($post_type, $post_types);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user