@@ -1807,28 +1807,28 @@ public function get_calendar_post_stati() {
18071807 return apply_filters ( 'ef_calendar_post_stati ' , $ final_statuses );
18081808 }
18091809
1810- public function get_calendar_dropdown_users () {
1811- $ users_dropdown_args = array (
1810+ public function get_calendar_users () {
1811+ $ users_args = array (
18121812 'orderby ' => 'display_name ' ,
18131813 'order ' => 'ASC ' ,
18141814 'blog_id ' => get_current_blog_id ()
18151815 );
18161816
1817- $ users_dropdown_args = apply_filters ( 'ef_calendar_dropdown_users_args ' , $ users_dropdown_args );
1817+ $ users_args = apply_filters ( 'ef_calendar_dropdown_users_args ' , $ users_args );
18181818
1819- return get_users ( $ users_dropdown_args );
1819+ return get_users ( $ users_args );
18201820 }
18211821
1822- public function get_calendar_categories_dropdown () {
1823- $ categories_dropdown_args = array (
1822+ public function get_calendar_categories () {
1823+ $ categories_args = array (
18241824 'orderby ' => 'id ' ,
18251825 'order ' => 'ASC ' ,
18261826 'hide_empty ' => 0 ,
18271827 'hierarchical ' => 0 ,
18281828 'taxonomy ' => 'category '
18291829 );
18301830
1831- return get_terms ( $ categories_dropdown_args );
1831+ return get_terms ( $ categories_args );
18321832 }
18331833
18341834 public function get_calendar_frontend_config () {
@@ -1837,48 +1837,18 @@ public function get_calendar_frontend_config() {
18371837 $ all_post_types = get_post_types ( null , 'objects ' );
18381838
18391839 $ config = array (
1840- 'POST_STATI ' => array_merge (
1841- array (
1842- array (
1843- 'label ' => 'Unpublish ' ,
1844- 'name ' => 'unpublish '
1845- )
1846- ),
1847- array_map (
1848- function ( $ item ) {
1849- return array (
1850- 'name ' => $ item ->name ,
1851- 'label ' => $ item ->label ,
1852- );
1853- },
1854- $ this ->get_calendar_post_stati ()
1855- )
1856- ),
1840+ 'POST_STATI ' => $ this ->get_calendar_post_stati (),
18571841 'USERS ' => array_map (
18581842 function ( $ item ) {
18591843 return array (
18601844 'id ' => $ item ->ID ,
18611845 'display_name ' => $ item ->display_name ,
18621846 );
18631847 },
1864- $ this ->get_calendar_dropdown_users ()
1865- ),
1866- 'CATEGORIES ' => array_map (
1867- function ( $ item ) {
1868- return array (
1869- 'term_id ' => $ item ->term_id ,
1870- 'name ' => $ item ->name ,
1871- 'parent ' => $ item ->parent
1872- );
1873- },
1874- $ this ->get_calendar_categories_dropdown ()
1848+ $ this ->get_calendar_users ()
18751849 ),
1876- 'CALENDAR_POST_TYPES ' => array_map ( function ( $ item ) use ( $ all_post_types ) {
1877- return array (
1878- 'name ' => $ all_post_types [ $ item ]->name ,
1879- 'label ' => $ all_post_types [ $ item ]->label
1880- );
1881- }, $ this ->get_post_types_for_module ( $ this ->module ) ),
1850+ 'CATEGORIES ' => $ this ->get_calendar_categories (),
1851+ 'POST_TYPES ' => $ this ->get_post_types_for_module ( $ this ->module ),
18821852 'NUM_WEEKS ' => array (
18831853 'MAX ' => $ this ->max_weeks ,
18841854 'DEFAULT ' => $ this ->total_weeks ,
0 commit comments