Is Pagebuilder detection working?

Posted in: Newsmag
Post count: 13

Looking at the code in the file page-pagebuilder-title.php, I don’t see how the page builder detection is working, since once the variable is set, it’s never tested:

...
/**
* detect the page builder
*/
$td_use_page_builder = false;
if (method_exists('WPBMap', 'getShortCodes')) {
$td_page_builder_short_codes = array_keys(WPBMap::getShortCodes());
if (td_util::strpos_array($post->post_content, $td_page_builder_short_codes) === true) {
$td_use_page_builder = true;
}
}

//no page builder detected, we load a default page template with sidebar / no sidebar
?>
<div class="td-container">
<div class="td-container-border">
<div class="td-pb-row">
<?php
switch ($loop_sidebar_position) {
...

Post count: 6535

Hi

On page-builder+title post template is no need to detect the page-builder as the page structure is different. The indicated code remained there from previous versions of the theme but no have no usage with the current implementation and can be removed with no problems.

Thanks!

  • This reply was modified 10 years by Andrei L..
Post count: 13

Thanks for the response. The theme is loaded with features, but that also makes it very complicated and confusing to newcomers. It would be great if this were cleaned up, at least in the UI, so that it will be less confusing.

Post count: 6535

Hi

We try to keep the code as clean and simple as possible but with every new feature added the code grows and it can be difficult to understand. At every update we try to optimize the code for best performance but this code somehow has left there.

Thanks!

Post count: 13

Hi,

I don’t mean to drag this on, but I just want to clarify one point. I’m not bothered about what’s in the code, but rather what it says in the UI when editing a page. It says, “Note: The settings from this box only work if you do not use visual composer on this template. The template detects if visual composer is used and it removes the title and sidebars if that’s the case.”

However, that didn’t seem to be the case, which is what sent me to go looking in the code. As I said, for a person who’s just starting out, I think there’s enough stuff to figure out without the confusion over this.

Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.