plugin update (wp-media-folder)

This commit is contained in:
Tony Volpe
2024-09-05 11:05:17 -04:00
parent 50cd64dd3d
commit daa614524b
20 changed files with 16137 additions and 73 deletions

View File

@@ -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);
}
}