/** * Add all the necessary body classes. * @param $classes * @return array * @since 0.1.0 */ public function body_class($classes) { if (pootlepb_is_panel()) { $classes[] = 'ppb-panels'; } return $classes; }
public function generate_css() { do_action('eighteen_tags_before_generate_css'); $css = "/*-----STOREFRONT PRO-----*/"; $css .= $this->header_nav_styles->styles(); $css .= $this->content_styles->styles(); $css .= $this->footer_styles->styles(); $css .= '@media only screen and (min-width: 763px) {'; $css .= self::$desktop_css; $css .= '}'; $css .= '@media only screen and (max-width: 763px) {'; $css .= self::$mobile_css; $css .= '}'; if (function_exists('et_pb_is_pagebuilder_used') && et_pb_is_pagebuilder_used(get_the_ID())) { $css .= '#content > .col-full { max-width: none; margin: 0; }'; $css .= strip_tags($this->page_builder_styles()); } else { if (function_exists('pootlepb_is_panel') && pootlepb_is_panel()) { $css .= strip_tags($this->page_builder_styles()); } } return $css; }
/** * @param $admin_bar */ function admin_bar_menu($admin_bar) { ?> <style> #wpadminbar #wp-admin-bar-pootle-live-editor .ab-item:before { content: "\f180"; top: 1px; } #wpadminbar li#wp-admin-bar-ppb-publish { display: block; } #wp-admin-bar-ppb-publish > a:before { content: "\f319"; top: 2px; } li[id^="wp-admin-bar-ppb-"] a { clear: both; } li[id^="wp-admin-bar-ppb-new-live-"] a:before { content: '\f180'; } li#wp-admin-bar-ppb-live-post-settings a:before { content: "\f111"; } </style> <?php global $post; //Checking nonce $nonce = filter_input(INPUT_GET, 'ppbLiveEditor'); $new_live_page_url = admin_url('admin-ajax.php'); $new_live_page_url = wp_nonce_url($new_live_page_url, 'ppb-new-live-post', 'ppbLiveEditor') . '&action=pootlepb_live_page'; $admin_bar->add_menu(array('parent' => 'new-content', 'id' => 'ppb-new-live-page', 'title' => 'Live Page', 'href' => $new_live_page_url)); $admin_bar->add_menu(array('parent' => 'new-content', 'id' => 'ppb-new-live-post', 'title' => 'Live Post', 'href' => $new_live_page_url . '&post_type=post')); if (wp_verify_nonce($nonce, 'ppb-live-edit-nonce') || wp_verify_nonce($nonce, 'ppb-live-' . get_the_id())) { if ('draft' == Pootle_Page_Builder_Live_Editor_Public::instance()->post_status()) { $args = array('id' => 'ppb-publish', 'title' => 'Save/Publish', 'href' => '#ppb-live-save-publish', 'meta' => array('title' => __('Save and publish your changes.'))); $admin_bar->add_menu($args); $args['parent'] = 'ppb-publish'; if ('post' == get_post_type()) { $args['id'] = 'ppb-live-post-settings'; $args['href'] = '#ppb-live-post-settings'; $args['title'] = 'Post settings'; $admin_bar->add_menu($args); } $args['id'] = 'ppb-live-update-changes'; $args['href'] = '#ppb-live-update-changes'; $args['title'] = 'Save'; $admin_bar->add_menu($args); $args['id'] = 'ppb-live-publish-changes'; $args['href'] = '#ppb-live-publish-changes'; $args['title'] = 'Publish'; $admin_bar->add_menu($args); } else { $args = array('id' => 'ppb-publish', 'title' => 'Update', 'href' => '#ppb-live-update-changes', 'meta' => array('title' => __('Save and publish your changes.'))); $admin_bar->add_menu($args); if ('post' == get_post_type()) { $args['parent'] = 'ppb-publish'; $args['id'] = 'ppb-live-post-settings'; $args['href'] = '#ppb-live-post-settings'; $args['title'] = 'Post settings'; $admin_bar->add_menu($args); } } } else { if (pootlepb_is_panel(true)) { $nonce_url = wp_nonce_url(get_the_permalink($post->ID), 'ppb-live-' . $post->ID, 'ppbLiveEditor'); $args = array('id' => 'pootle-live-editor', 'title' => 'Live edit', 'href' => $nonce_url, 'meta' => array('title' => __('Live edit this page with pootle page builder'))); $admin_bar->add_menu($args); } } }