Hi there I have a template that renders a ‘notification bar’ at the bottom of the page
The code to add that custom field is
add_filter("builder/settings/template/controls_data", function ($data) {
// Add control to get the MB custom field that has the selected set of pages
$data["controls"]["templateConditions"]["fields"]["promoPagesConfig"] = [
"type" => "text",
"label" => esc_html__("Promo Pages List", "bricks"),
"placeholder" => esc_html__(
"Page level MB custom field name",
"bricks"
),
"description" => esc_html__(
"Leave empty to apply template to all pages.",
"bricks"
),
"required" => ["main", "=", "any"],
];
return $data;
});
However, when I dump the ‘conditions’ object from the bricks/screen_conditions/scores hook, I dont see promoPagesConfig in it. My current scores hook code is:
add_filter(
"bricks/screen_conditions/scores",
function ($scores, $condition, $post_id, $preview_type) {
echo '<hr/><div style="display:grid;grid-template-columns:repeat(4, 1fr);"</div>';
c_var_dump($scores, "red");
c_var_dump($condition, "green");
c_var_dump($post_id, "blue");
c_var_dump($preview_type, "pink");
echo "</div><hr/>";
return $scores;
},
10,4
);
Can someone help?
