function enqueue_page_headings() { // Only need these on the public side of the site if (is_admin()) { return; } // Check if we are actually being used anywhere if (is_active_widget(false, false, 'sp_availabiltycalendar')) { // we are an active widget so add in our styles and js wp_enqueue_style('bookingwidgetcss', SPBCommon::booking_url('css/booking.calendarwidget.css'), array()); } }
function check_for_shortcodes($posts) { foreach ((array) $posts as $post) { if (strpos($post->post_content, '[availabilitycalendar') !== false) { if (!current_theme_supports('staypress_booking_style')) { // We have a calendar shortcode in here wp_enqueue_style('bookingwidgetcss', SPBCommon::booking_url('css/booking.calendarwidget.css'), array()); //wp_enqueue_script('googlemaps', "http://maps.google.com/maps/api/js?sensor=true", array(), $this->build, true); //wp_enqueue_script('propertymapshortcode', SPPCommon::property_url('js/property.mapshortcode.js'), array('googlemaps', 'jquery'), $this->build, true); } } } return $posts; }
function add_admin_menu() { global $menu, $_wp_last_object_menu; // Add the menu page add_menu_page(__('Booking Management', 'booking'), __('Bookings', 'booking'), 'edit_booking', 'booking', array(&$this, 'handle_booking_panel'), SPBCommon::booking_url('images/calendar.png')); // Move things about $keys = array_keys($menu); $menuaddedat = end($keys); $checkfrom = $_wp_last_object_menu + 1; while (isset($menu[$checkfrom])) { $checkfrom += 1; } // If we are here then we have found a slot $menu[$checkfrom] = $menu[$menuaddedat]; $_wp_last_object_menu = $checkfrom; // Remove the menu we originally added unset($menu[$menuaddedat]); // Add the sub menu add_submenu_page('booking', __('Add New Booking', 'booking'), __('Add New', 'booking'), 'edit_booking', "booking-add", array(&$this, 'show_bookingadd_panel')); // Add the settings pages if the user has the relevant permissions if (current_user_can('manage_categories')) { } if (current_user_can('manage_options')) { add_submenu_page('booking', __('Booking options', 'booking'), __('Edit Options', 'booking'), 'manage_options', "booking-options", array(&$this, 'show_options_panel')); } }