Advertisement
demon2cute

Badge OS for Easy directory

Apr 8th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.13 KB | None | 0 0
  1. <?php
  2. /**
  3. * Theme functions file
  4. *
  5. * DO NOT MODIFY THIS FILE. Make a child theme instead: http://codex.wordpress.org/Child_Themes
  6. *
  7. * @package Vantage
  8. * @author AppThemes
  9. */
  10.  
  11. // Constants
  12. define( 'VA_VERSION', '1.2.1' );
  13.  
  14. define( 'VA_META_KEY_PREFIX', 'va_' );
  15.  
  16. define( 'VA_LISTING_PTYPE', 'listing' );
  17. define( 'VA_LISTING_CATEGORY', 'listing_category' );
  18. define( 'VA_LISTING_TAG', 'listing_tag' );
  19. define( 'VA_LISTING_FAVORITES', 'va_favorites' );
  20.  
  21. define( 'VA_REVIEWS_CTYPE', 'review' );
  22. define( 'VA_REVIEWS_RATINGS', 'rating' );
  23. define( 'VA_REVIEWS_PER_PAGE', 10 );
  24.  
  25. define( 'VA_ITEM_REGULAR', 'regular' );
  26. define( 'VA_ITEM_FEATURED_HOME', 'featured-home' );
  27. define( 'VA_ITEM_FEATURED_CAT', 'featured-cat' );
  28. define( 'VA_ITEM_FEATURED', 'featured' );
  29.  
  30. define( 'VA_MAX_FEATURED', 5 );
  31. define( 'VA_MAX_IMAGES', 5 );
  32.  
  33. define( 'VA_ATTACHMENT_FILE', 'file' );
  34. define( 'VA_ATTACHMENT_GALLERY', 'gallery' );
  35.  
  36. define( 'APP_TD', 'vantage' );
  37.  
  38. global $va_options;
  39.  
  40. // Framework
  41. require dirname(__FILE__) . '/framework/load.php';
  42.  
  43. // Payments
  44. require dirname( __FILE__ ) . '/includes/payments/load.php';
  45.  
  46. // Events
  47. require dirname( __FILE__ ) . '/includes/events/load.php';
  48.  
  49. // Geo
  50. require dirname( __FILE__ ) . '/includes/geo/load.php';
  51.  
  52. // Theme-specific files
  53. require dirname( __FILE__ ) . '/includes/utils.php';
  54. require dirname( __FILE__ ) . '/includes/options.php';
  55. require dirname( __FILE__ ) . '/includes/core.php';
  56. require dirname( __FILE__ ) . '/includes/custom-post-type-helper.php';
  57. require dirname( __FILE__ ) . '/includes/capabilities.php';
  58. require dirname( __FILE__ ) . '/includes/views.php';
  59. require dirname( __FILE__ ) . '/includes/reviews.php';
  60. require dirname( __FILE__ ) . '/includes/custom-comment-type-helper.php';
  61. require dirname( __FILE__ ) . '/includes/favorites.php';
  62. require dirname( __FILE__ ) . '/includes/images.php';
  63. require dirname( __FILE__ ) . '/includes/files.php';
  64. require dirname( __FILE__ ) . '/includes/categories.php';
  65. require dirname( __FILE__ ) . '/includes/template-tags.php';
  66. require dirname( __FILE__ ) . '/includes/widgets.php';
  67. require dirname( __FILE__ ) . '/includes/emails.php';
  68. require dirname( __FILE__ ) . '/includes/custom-forms.php';
  69. require dirname( __FILE__ ) . '/includes/featured.php';
  70. require dirname( __FILE__ ) . '/includes/dashboard.php';
  71. require dirname( __FILE__ ) . '/includes/admin-bar.php';
  72.  
  73. require dirname( __FILE__ ) . '/includes/locale.php';
  74. global $va_locale;
  75. $va_locale = new VA_Locale;
  76.  
  77. require dirname( __FILE__ ) . '/includes/payments.php';
  78.  
  79. if( !is_admin() )
  80. require dirname( __FILE__ ) . '/framework/admin/class-tabs-page.php';
  81.  
  82. require dirname( __FILE__ ) . '/includes/checkout/class-checkout.php';
  83. require dirname( __FILE__ ) . '/includes/checkout/class-checkout-list.php';
  84. require dirname( __FILE__ ) . '/includes/checkout/class-checkout-step.php';
  85. require dirname( __FILE__ ) . '/includes/checkout/checkout-tags.php';
  86.  
  87. require dirname( __FILE__ ) . '/includes/checkout/views-checkout.php';
  88. new VA_Gateway_Select;
  89. new VA_Gateway_Process;
  90. new VA_Order_Summary;
  91.  
  92. if( defined( 'WP_DEBUG' ) && WP_DEBUG )
  93. require dirname( __FILE__ ) . '/includes/checkout/checkout-dev.php';
  94.  
  95. require dirname( __FILE__ ) . '/includes/listing-form.php';
  96. new VA_Listing_Info_Edit;
  97. new VA_Listing_Info_Purchase;
  98.  
  99. require dirname( __FILE__ ) . '/includes/listing-status.php';
  100.  
  101. require dirname( __FILE__ ) . '/includes/listing-purchase.php';
  102. new VA_Select_Plan_New;
  103. new VA_Select_Plan_Existing;
  104.  
  105. require dirname( __FILE__ ) . '/includes/listing-activate.php';
  106. require dirname( __FILE__ ) . '/includes/listing-claim.php';
  107. require dirname( __FILE__ ) . '/includes/listing-renew.php';
  108.  
  109. require dirname( __FILE__ ) . '/includes/customizer.php';
  110.  
  111. if ( is_admin() ) {
  112. require dirname( __FILE__ ) . '/framework/admin/importer.php';
  113. require dirname( __FILE__ ) . '/framework/admin/class-meta-box.php';
  114.  
  115. require dirname( __FILE__ ) . '/includes/admin/dashboard.php';
  116. new VA_Dashboard;
  117.  
  118. require dirname( __FILE__ ) . '/includes/admin/settings.php';
  119. require dirname( __FILE__ ) . '/includes/admin/admin.php';
  120. require dirname( __FILE__ ) . '/includes/admin/pricing.php';
  121. require dirname( __FILE__ ) . '/includes/admin/listing-single.php';
  122. require dirname( __FILE__ ) . '/includes/admin/listing-list.php';
  123. require dirname( __FILE__ ) . '/includes/admin/featured.php';
  124. require dirname( __FILE__ ) . '/includes/admin/category-surcharge.php';
  125.  
  126. new VA_Pricing_General_Box();
  127. new VA_Pricing_Addon_Box();
  128.  
  129. add_filter( 'manage_' . VA_LISTING_PTYPE . '_posts_columns', 'va_listing_manage_columns' );
  130.  
  131. new VA_Listing_Location_Meta;
  132. new VA_Listing_Contact_Meta;
  133. new VA_Listing_Pricing_Meta;
  134. new VA_Listing_Publish_Moderation;
  135. new VA_Listing_Claim_Moderation;
  136. new VA_Listing_Claimable_Meta;
  137. new VA_Listing_Gallery_Meta;
  138. new VA_Listing_Reviews_Status_Meta;
  139. new VA_Listing_Author_Meta;
  140.  
  141. $va_settings_admin = new VA_Settings_Admin( $va_options );
  142. add_action( 'admin_init', array( $va_settings_admin, 'init_integrated_options' ), 10 );
  143. }
  144.  
  145. add_theme_support( 'app-versions', array(
  146. 'update_page' => 'admin.php?page=app-settings&firstrun=1',
  147. 'current_version' => VA_VERSION,
  148. 'option_key' => 'vantage_version',
  149. ) );
  150.  
  151. add_theme_support( 'app-wrapping' );
  152.  
  153. add_theme_support( 'app-login', array(
  154. 'login' => 'form-login.php',
  155. 'register' => 'form-registration.php',
  156. 'recover' => 'form-password-recovery.php',
  157. 'reset' => 'form-password-reset.php',
  158. ) );
  159.  
  160. add_theme_support( 'app-payments', array(
  161. 'items' => array(
  162. array(
  163. 'type' => VA_ITEM_REGULAR,
  164. 'title' => __( 'Regular Listing', APP_TD ),
  165. 'meta' => array(
  166. 'price' => $va_options->listing_price
  167. )
  168. ),
  169. array(
  170. 'type' => VA_ITEM_FEATURED_HOME,
  171. 'title' => __( 'Feature on Homepage', APP_TD ),
  172. 'meta' => array(
  173. 'price' => $va_options->addons[ VA_ITEM_FEATURED_HOME ]['price']
  174. )
  175. ),
  176. array(
  177. 'type' => VA_ITEM_FEATURED_CAT,
  178. 'title' => __( 'Feature on Category', APP_TD ),
  179. 'meta' => array(
  180. 'price' => $va_options->addons[ VA_ITEM_FEATURED_CAT ]['price']
  181. )
  182. )
  183. ),
  184. 'items_post_types' => array( VA_LISTING_PTYPE ),
  185. 'options' => $va_options,
  186. ) );
  187.  
  188. add_theme_support( 'app-price-format', array(
  189. 'currency_default' => $va_options->currency_code,
  190. 'currency_format' => $va_options->currency_identifier,
  191. 'currency_position' => $va_options->currency_position,
  192. 'thousands_separator' => $va_options->thousands_separator,
  193. 'decimal_separator' => $va_options->decimal_separator,
  194. 'hide_decimals' => (bool) ( ! $va_options->decimal_separator ),
  195. ) );
  196.  
  197. add_theme_support( 'app-events', array(
  198. 'meta_key_prefix' => VA_META_KEY_PREFIX,
  199. 'post_type' => 'event',
  200. 'category' => 'event_category',
  201. 'tag' => 'event_tag',
  202. 'day' => 'event_day',
  203. 'comment_type' => 'event_comment',
  204. 'attendee_connection' => 'event-attendee',
  205. 'options' => $va_options
  206. ) );
  207.  
  208. add_theme_support( 'app-geo-2', array(
  209. 'options' => $va_options,
  210. ) );
  211.  
  212. add_theme_support( 'app-term-counts', array(
  213. 'post_type' => array( VA_LISTING_PTYPE ),
  214. 'post_status' => array( 'publish' ),
  215. 'taxonomy' => array( VA_LISTING_CATEGORY ),
  216. ) );
  217.  
  218. add_theme_support( 'app-feed', array(
  219. 'post_type' => VA_LISTING_PTYPE,
  220. 'blog_template' => 'index.php',
  221. 'alternate_feed_url' => '',
  222. ) );
  223.  
  224. new APP_User_Profile;
  225.  
  226. new VA_Home_Archive;
  227. new VA_Blog_Archive;
  228. new VA_Listing_Archive;
  229. new VA_Listing_Categories;
  230. new VA_Listing_Taxonomy;
  231. new VA_Listing_Search;
  232. new VA_Listing_Create;
  233. new VA_Listing_Purchase;
  234. new VA_Listing_Claim;
  235. new VA_Listing_Edit;
  236. new VA_Listing_Renew;
  237. new VA_Listing_Single;
  238. new VA_Listing_Author;
  239. new VA_Listing_Dashboard;
  240.  
  241. // Taxonomies need to be registered before the post type, in order for the rewrite rules to work
  242. add_action( 'init', 'va_register_taxonomies', 8 );
  243. add_action( 'init', 'va_register_post_types', 9 );
  244.  
  245. // Flush rewrite rules if the related transient is set
  246. add_action( 'init','va_check_rewrite_rules_transient', 10 );
  247.  
  248. // Add a very low priority action to make sure any extra settings have been added to the permalinks global
  249. add_action( 'admin_init', 'va_enable_permalink_settings', 999999 );
  250.  
  251. add_action( 'user_contactmethods', 'va_user_contact_methods' );
  252. if ( !is_admin() ) {
  253. add_action( 'user_profile_update_errors', 'va_user_update_profile', 10, 3 );
  254. }
  255.  
  256. add_action( 'template_redirect', 'va_add_style' );
  257. add_action( 'template_redirect', 'va_add_scripts' );
  258.  
  259. add_action( 'appthemes_before_login_template', 'va_add_login_style' );
  260.  
  261. add_action( 'after_setup_theme', 'va_setup_theme' );
  262.  
  263. add_filter( 'wp_nav_menu_objects', 'va_disable_hierarchy_in_footer', 9, 2 );
  264.  
  265. add_filter( 'body_class', 'va_body_class' );
  266.  
  267. add_filter( 'excerpt_more', 'va_excerpt_more' );
  268. add_filter( 'excerpt_length', 'va_excerpt_length' );
  269. add_filter( 'the_excerpt', 'strip_tags' );
  270.  
  271. add_action( 'wp_login', 'va_redirect_to_front_page' );
  272. add_action( 'app_login', 'va_redirect_to_front_page' );
  273. add_action( 'login_enqueue_scripts', 'va_login_styling' );
  274. add_filter( 'login_headerurl', 'va_login_logo_url' );
  275. add_filter( 'login_headertitle', 'va_login_logo_url_title' );
  276.  
  277. // ShareThis plugin compatibility
  278. remove_filter( 'the_content', 'st_add_widget' );
  279.  
  280. // Social Connect plugin compatibility
  281. add_action( 'app_login_pre_redirect', 'social_connect_grab_login_redirect' );
  282.  
  283. appthemes_init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement