/** * 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); } } } } }
/** * Retrieve all of the data for the sections. * * Note that in 1.2.0, this function was changed to call the global function. This global function was added to * provide easier reuse of the function. In order to maintain backwards compatibility, this function is left in * place. * * @since 1.0.0. * * @param string $post_id The post to retrieve the data from. * @return array The combined data. */ public function get_section_data($post_id) { return ttfmake_get_section_data($post_id); }