예제 #1
0
/**
 * Add debug info if HOOT_DEBUG is true
 *
 * @since 2.0.0
 * @access public
 */
function hoot_add_debug_info()
{
    if (current_user_can('manage_options')) {
        echo "\n<!-- HOOT DEBUG INFO-->\n";
        if (function_exists('hoot_developer_data')) {
            echo "\n<!-- " . hoot_developer_data() . "-->\n";
        }
        $info = defined('HOOT_DEBUG') && true === HOOT_DEBUG ? hoot_debug_info('', true) : '';
        if ($info) {
            echo "<!--\n" . $info . "\n-->";
        }
    }
}
예제 #2
0
/**
 * Add the customizer sections
 *
 * @since 2.0.0
 * @param array $sections
 * @return void
 */
function hoot_customizer_add_sections($sections, $wp_customize)
{
    $loop = 160;
    foreach ($sections as $id => $section) {
        if (!isset($section['description'])) {
            $section['description'] = FALSE;
        }
        if (!isset($section['priority']) || !is_numeric($section['priority'])) {
            $loop += 10;
            $section['priority'] = $loop;
        }
        if (defined('HOOT_DEBUG') && true === HOOT_DEBUG) {
            hoot_debug_info("Section [{$section['priority']}] {$id}\n");
        }
        $wp_customize->add_section($id, $section);
    }
}