| Conditions | 2 |
| Paths | 2 |
| Total Lines | 63 |
| Code Lines | 37 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 14 | function gd_buddyboss_action_calls(){ |
||
| 15 | // listings page remove |
||
| 16 | remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
||
| 17 | remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
||
| 18 | remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
||
| 19 | remove_action('geodir_listings_page_description', 'geodir_action_listings_description', 10); |
||
| 20 | remove_action('geodir_listings_page_description', 'geodir_location_action_listings_description', 100); // for location manager |
||
| 21 | remove_action('geodir_listings_page_description', 'geodir_cpt_pt_desc', 10); //CPT manager |
||
| 22 | |||
| 23 | //listing page add |
||
| 24 | add_action('geodir_listings_content', 'geodir_breadcrumb', 3); |
||
| 25 | add_action('geodir_listings_content', 'geodir_action_geodir_sidebar_listings_top', 4); |
||
| 26 | add_action('geodir_listings_content', 'geodir_cpt_pt_desc', 5); //CPT manager |
||
| 27 | if(defined("GEODIRLOCATION_VERSION")){ |
||
| 28 | add_action('geodir_listings_content', 'geodir_location_action_listings_description', 5); |
||
| 29 | }else{ |
||
| 30 | add_action('geodir_listings_content', 'geodir_action_listings_description', 5); |
||
| 31 | } |
||
| 32 | add_action('geodir_listings_content', 'geodir_action_listings_title', 9); |
||
| 33 | |||
| 34 | |||
| 35 | // details page remove |
||
| 36 | remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_set_preview_post', 8); |
||
| 37 | remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_preview_code', 9); |
||
| 38 | remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
||
| 39 | remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
||
| 40 | |||
| 41 | |||
| 42 | //details page add |
||
| 43 | add_action('geodir_article_open', 'geodir_action_geodir_set_preview_post', 1); |
||
| 44 | add_action('geodir_article_open','geodir_action_geodir_preview_code', 2); |
||
| 45 | add_action('geodir_article_open', 'geodir_breadcrumb', 3); |
||
| 46 | add_action('geodir_article_open', 'geodir_action_geodir_sidebar_detail_top', 5); |
||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | //location/home remove |
||
| 51 | remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
||
| 52 | remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
||
| 53 | |||
| 54 | remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
||
| 55 | remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
||
| 56 | |||
| 57 | //location/home add |
||
| 58 | add_action('geodir_home_content', 'geodir_breadcrumb', 3); |
||
| 59 | add_action('geodir_location_content', 'geodir_breadcrumb', 3); |
||
| 60 | |||
| 61 | add_action('geodir_home_content', 'geodir_action_geodir_sidebar_home_top', 5); |
||
| 62 | add_action('geodir_location_content', 'geodir_action_geodir_sidebar_home_top', 5); |
||
| 63 | |||
| 64 | // search remove |
||
| 65 | remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
||
| 66 | remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
||
| 67 | remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
||
| 68 | |||
| 69 | //search add |
||
| 70 | add_action('geodir_search_content', 'geodir_action_geodir_sidebar_search_top', 5); |
||
| 71 | add_action('geodir_search_content', 'geodir_breadcrumb', 3); |
||
| 72 | add_action('geodir_search_content', 'geodir_action_search_page_title', 6); |
||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | } |
||
| 77 | |||
| 89 |