/** * Format content to fix shortcodes. * @param string $content * @return string */ function ac_fix_shortcodes($content) { global $post; if (is_singular() && is_pagebuilder_active($post->ID)) { $content = ac_format_shortcode($content); } return $content; }
/** * Print after the title field. * @param WP_Post $post */ public function edit_form_after_title($post) { if (in_array($post->post_type, ac_get_allowed_screen_types())) { $params = apply_filters('axiscomposer_editors_toggle_params', array('notice' => '', 'disabled' => false, 'builder_label' => __('Use Page Builder', 'axiscomposer'), 'default_label' => __('Use Default Editor', 'axiscomposer'), 'disable_label' => __('Page Builder Disabled', 'axiscomposer')), $post); if (is_pagebuilder_active($post->ID)) { $button_label = $params['default_label']; $button_class = 'button-secondary'; $editor_class = 'ac-hidden-editor'; } elseif ($params['disabled']) { $button_label = $params['disable_label']; $button_class = 'button-secondary disabled'; $editor_class = 'ac-visible-editor'; } else { $button_label = $params['builder_label']; $button_class = 'button-primary'; $editor_class = 'ac-visible-editor'; } echo '<a href="#" id="_toggle_editor" class="button button-large ' . $button_class . ' axiscomposer-toggle-editor" data-builder="' . esc_attr($params['builder_label']) . '" data-editor="' . esc_attr($params['default_label']) . '">' . esc_html($button_label) . '</a>'; echo '<div id="postdivrich_wrap" class="axiscomposer ' . $editor_class . '">'; if ($params['notice']) { echo '<div class="ac_plugin_display_notice ' . esc_attr($params['disabled'] ? 'inactive' : 'active') . '">' . esc_html($params['notice']) . '</div>'; } } }
/** * Filter the postbox classes for a specific screen and screen ID combo. * @param array $classes An array of postbox classes. * @return array $classes */ public static function postbox_classes($classes) { // Class for Debug Mode. if (true === AC_BUILDER_DEBUG_MODE) { $classes[] = 'ac-debug'; } // Class for hidden items. if (empty($_GET['post']) || isset($_GET['post']) && is_pagebuilder_active($_GET['post']) === false) { $classes[] = 'ac-hidden'; } return $classes; }