/** * Trigger an action hook for each section on a Builder page for the purpose * of adding section-specific CSS rules to the document head. * * @since 1.4.5 * * @return void */ function ttfmake_builder_css() { if (ttfmake_is_builder_page()) { $sections = ttfmake_get_section_data(get_the_ID()); if (!empty($sections)) { foreach ($sections as $id => $data) { if (isset($data['section-type'])) { /** * Allow section-specific CSS rules to be added to the document head of a Builder page. * * @since 1.4.5 * * @param array $data The Builder section's data. * @param int $id The ID of the Builder section. */ do_action('make_builder_' . $data['section-type'] . '_css', $data, $id); } } } } }
/** * Add a class to indicate the current template being used. * * @since 1.0.4. * * @param array $classes The current classes. * @return array The modified classes. */ function admin_body_class($classes) { global $pagenow; // Do not complete the function if the product template is in use (i.e., the builder needs to be shown) if (ttfmake_post_type_supports_builder(get_post_type())) { if ('post-new.php' === $pagenow || 'post.php' === $pagenow && ttfmake_is_builder_page()) { $classes .= ' ttfmake-builder-active'; // Add a class to denote Make Plus if (ttfmake_is_plus()) { $classes .= ' make-plus-enabled'; } else { $classes .= ' make-plus-disabled'; } } else { $classes .= ' ttfmake-default-active'; } // Add a class to denote Make Plus if (ttfmake_is_plus()) { $classes .= ' make-plus-enabled'; } else { $classes .= ' make-plus-disabled'; } } return $classes; }