/** * Load tooltips for the current screen. * Avoids loading multiple tooltip instances on metaboxes. */ public function init_tooltips() { if (!appthemes_get_instance('APP_ToolTips')) { appthemes_add_instance(array('APP_ToolTips' => array(get_current_screen()->id))); } }
} scb_register_table('app_pop_daily', 'cp_ad_pop_daily'); scb_register_table('app_pop_total', 'cp_ad_pop_total'); $load_files = array('checkout/load.php', 'payments/load.php', 'reports/load.php', 'widgets/load.php', 'admin/addons-mp/load.php', 'options.php', 'appthemes-functions.php', 'actions.php', 'categories.php', 'comments.php', 'core.php', 'cron.php', 'custom-forms.php', 'deprecated.php', 'enqueue.php', 'emails.php', 'functions.php', 'hooks.php', 'images.php', 'packages.php', 'payments.php', 'profile.php', 'search.php', 'security.php', 'stats.php', 'views.php', 'views-checkout.php', 'widgets.php', 'theme-support.php', 'customizer.php', 'utils.php', 'checkout/form-progress/load.php'); appthemes_load_files(dirname(__FILE__) . '/includes/', $load_files); $load_classes = array('CP_Blog_Archive', 'CP_Posts_Tag_Archive', 'CP_Post_Single', 'CP_Author_Archive', 'CP_Ads_Tag_Archive', 'CP_Ads_Archive', 'CP_Ads_Home', 'CP_Ads_Categories', 'CP_Add_New', 'CP_Renew_Listing', 'CP_Ad_Single', 'CP_Edit_Item', 'CP_Membership', 'CP_User_Dashboard', 'CP_User_Dashboard_Orders', 'CP_User_Profile', 'CP_Order', 'CP_Membership_Form_Select', 'CP_Membership_Form_Preview', 'CP_Listing_Form_Select_Category', 'CP_Listing_Form_Edit', 'CP_Listing_Form_Details', 'CP_Listing_Form_Preview', 'CP_Listing_Form_Submit_Free', 'CP_Gateway_Select', 'CP_Gateway_Process', 'CP_Order_Summary', 'CP_Widget_125_Ads', 'CP_Widget_Ad_Categories', 'CP_Widget_Ad_Sub_Categories', 'CP_Widget_Ads_Tag_Cloud', 'CP_Widget_Blog_Posts', 'CP_Widget_Facebook', 'CP_Widget_Featured_Ads', 'CP_Widget_Search', 'CP_Widget_Sold_Ads', 'CP_Widget_Top_Ads_Today', 'CP_Widget_Top_Ads_Overall'); appthemes_add_instance($load_classes); // Admin only if (is_admin()) { require_once APP_FRAMEWORK_DIR . '/admin/importer.php'; $load_files = array('admin.php', 'dashboard.php', 'enqueue.php', 'install.php', 'importer.php', 'listing-single.php', 'listing-list.php', 'options.php', 'package-single.php', 'package-list.php', 'settings.php', 'system-info.php', 'updates.php'); appthemes_load_files(dirname(__FILE__) . '/includes/admin/', $load_files); $load_classes = array('CP_Theme_Dashboard', 'CP_Theme_Settings_General' => $cp_options, 'CP_Theme_Settings_Emails' => $cp_options, 'CP_Theme_Settings_Pricing' => $cp_options, 'CP_Theme_System_Info', 'CP_Listing_Package_General_Metabox', 'CP_Membership_Package_General_Metabox', 'CP_Listing_Attachments_Metabox', 'CP_Listing_Media' => array('_app_media', __('Attachments', APP_TD), APP_POST_TYPE, 'normal', 'low'), 'CP_Listing_Author_Metabox', 'CP_Listing_Info_Metabox', 'CP_Listing_Custom_Forms_Metabox', 'CP_Listing_Pricing_Metabox'); appthemes_add_instance($load_classes); // integrate custom permalinks in WP permalinks page $settings = appthemes_get_instance('CP_Theme_Settings_General'); add_action('admin_init', array($settings, 'init_integrated_options'), 10); } // Frontend only if (!is_admin()) { cp_load_all_page_templates(); } // Constants define('CP_DASHBOARD_URL', get_permalink(CP_User_Dashboard::get_id())); define('CP_DASHBOARD_ORDERS_URL', get_permalink(CP_User_Dashboard_Orders::get_id())); define('CP_PROFILE_URL', get_permalink(CP_User_Profile::get_id())); define('CP_EDIT_URL', get_permalink(CP_Edit_Item::get_id())); define('CP_ADD_NEW_URL', get_permalink(CP_Add_New::get_id())); define('CP_MEMBERSHIP_PURCHASE_URL', get_permalink(CP_Membership::get_id())); // Set the content width based on the theme's design and stylesheet. // Used to set the width of images and content. Should be equal to the width the theme
/** * Execute changes made in ClassiPress 3.4. * * @since 3.4 */ function cp_upgrade_340() { global $cp_options; // rename and change the moderation option from radio to checkbox $moderate = $cp_options->post_status == 'pending'; $cp_options->moderate_ads = $moderate; // convert packages to custom post types cp_upgrade_packages_340(); // remove old pages $args = array('post_type' => 'page', 'meta_query' => array(array('key' => '_wp_page_template', 'value' => array('tpl-add-new.php', 'tpl-membership-purchase.php', 'tpl-edit-item.php'), 'compare' => 'IN')), 'posts_per_page' => -1, 'suppress_filters' => true); $old_pages = new WP_Query($args); if ($old_pages->have_posts()) { foreach ($old_pages->posts as $old_page) { wp_delete_post($old_page->ID, true); } } // migrate logo options to 'custom-header' theme support if (!$cp_options->use_logo) { // logo wasn't used, uset the default one set_theme_mod('header_image', 'remove-header'); remove_theme_mod('header_image_data'); } else { if ($cp_options->logo && ($importer = appthemes_get_instance('CP_Importer'))) { // create new attachment from old logo $attachment_id = $importer->process_attachment($cp_options->logo, 0); if (!is_wp_error($attachment_id) && ($attachment_attr = wp_get_attachment_image_src($attachment_id, 'full'))) { $data = array(); $data['url'] = esc_url_raw($attachment_attr[0]); $header_image_data = (object) array('attachment_id' => $attachment_id, 'url' => $data['url'], 'thumbnail_url' => $data['url'], 'height' => $attachment_attr[2], 'width' => $attachment_attr[1]); update_post_meta($attachment_id, '_wp_attachment_is_custom_header', get_stylesheet()); set_theme_mod('header_image', $data['url']); set_theme_mod('header_image_data', $header_image_data); set_theme_mod('header_textcolor', 'blank'); } } } // collect orders ids to update data if (!($order_ids = get_option('cp_upgrade_340_orders'))) { // get all orders ids $args = array('post_type' => APPTHEMES_ORDER_PTYPE, 'post_status' => 'any', 'posts_per_page' => -1, 'fields' => 'ids'); $orders = new WP_Query($args); if (isset($orders->posts) && is_array($orders->posts)) { update_option('cp_upgrade_340_orders', $orders->posts); } else { update_option('cp_upgrade_340_orders', 'done'); } } update_option('cp_db_version', '2221'); }