/**
 * nrelate Related Content Settings
 *
 * @package nrelate
 * @subpackage Functions
 */
function options_init_nr_rc()
{
    register_setting('nrelate_related_options', 'nrelate_related_options', 'related_options_validate');
    $options = get_option('nrelate_related_options');
    // Display preview image
    if ($options['related_thumbnail'] == "Thumbnails") {
        $divstyle = 'style="display:block;"';
    } else {
        $divstyle = 'style="display:none;"';
    }
    if (isset($options['related_show_post_title']) && $options['related_show_post_title'] == 'on') {
        $showpost_divstyle = 'style="display:block;"';
    } else {
        $showpost_divstyle = 'style="display:none;"';
    }
    if (isset($options['related_show_post_excerpt']) && $options['related_show_post_excerpt'] == 'on') {
        $showexcerpt_divstyle = 'style="display:block;"';
    } else {
        $showexcerpt_divstyle = 'style="display:none;"';
    }
    // Main Section
    add_settings_section('main_section', __('Main Settings', 'nrelate'), 'section_text_nr_rc', __FILE__);
    add_settings_field('related_save_preview_top', '', 'nrelate_save_preview', __FILE__, 'main_section');
    add_settings_field('related_thumbnail', __('Would you like to display thumbnails with text, or text only', 'nrelate') . nrelate_tooltip('_thumbnail'), 'setting_thumbnail', __FILE__, 'main_section');
    add_settings_field('related_thumbnail_size', __('<div class="nr_image_option" ' . $divstyle . '>Please choose a thumbnail size', 'nrelate') . nrelate_tooltip('_thumbnail_size') . '</div>', 'setting_thumbnail_size', __FILE__, 'main_section');
    add_settings_field('related_default_image', __('<div class="nr_image_option" ' . $divstyle . '>Please provide a link to your default image: (This will show up when a related post does not have a picture in it)<br/><i>For best results image should be as large (or larger) than the thumbnail size you chose above.</i>', 'nrelate') . nrelate_tooltip('_default_image') . "</div>", 'setting_related_default_image', __FILE__, 'main_section');
    add_settings_field('related_custom_field', __('<div class="nr_image_option" ' . $divstyle . '>If you use <b>Custom Fields</b> for your images, nrelate can show them.</div>', 'nrelate'), 'setting_related_custom_field', __FILE__, 'main_section');
    add_settings_field('related_title', __('Please enter a title for the related content box', 'nrelate') . nrelate_tooltip('_title'), 'setting_string_nr_rc', __FILE__, 'main_section');
    add_settings_field('related_number_of_posts', __('<b>Maximum</b> number of posts to display from this site</br><em>To display multiple rows of thumbnails, choose more than will fit in one row.</em>', 'nrelate') . nrelate_tooltip('_number_of_posts'), 'setting_related_number_of_posts_nr_rc', __FILE__, 'main_section');
    add_settings_field('related_bar', __('How relevant do you want the results to be?<br/><i>Based on the amount/type of content on your website, medium and high relevancy settings may return little or no posts.</i>', 'nrelate'), 'setting_related_bar_nr_rc', __FILE__, 'main_section');
    add_settings_field('related_max_age', __('How deep into your archive would you like to go for related posts?', 'nrelate') . nrelate_tooltip('_max_age'), 'setting_related_max_age', __FILE__, 'main_section');
    add_settings_field('related_exclude_cats', __('Exclude Categories from your related content.', 'nrelate') . nrelate_tooltip('_exclude_cats'), 'nrelate_text_exclude_categories', __FILE__, 'main_section');
    add_settings_field('related_show_post_title', '<a name="nrelate_show_post_title"></a>' . __('Show Post Title?', 'nrelate') . nrelate_tooltip('_show_post_title'), 'setting_related_show_post_title', __FILE__, 'main_section');
    add_settings_field('related_max_chars_per_line', __('<div class="nr_showpost_option" ' . $showpost_divstyle . '>Maximum number of characters for title?', 'nrelate') . nrelate_tooltip('_max_chars_per_line') . '</div>', 'setting_related_max_chars_per_line', __FILE__, 'main_section');
    add_settings_field('related_show_post_excerpt', '<a name="nrelate_show_post_excerpt"></a>' . __('Show Post Excerpt?', 'nrelate') . nrelate_tooltip('_show_post_excerpt'), 'setting_related_show_post_excerpt', __FILE__, 'main_section');
    add_settings_field('related_max_chars_post_excerpt', __('<div class="nr_showexcerpt_option" ' . $showexcerpt_divstyle . '>Maximum number of words for post excerpt?', 'nrelate') . nrelate_tooltip('_max_chars_post_excerpt') . '</div>', 'setting_related_max_chars_post_excerpt', __FILE__, 'main_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'main_section');
    //Partner Section
    add_settings_section('partner_section', __('Partner Settings', 'nrelate'), 'section_text_nr_rc_partner', __FILE__);
    add_settings_field('related_blogoption', __('Would you like to display related content from any of your blogroll categories?', 'nrelate'), 'setting_related_blogoption', __FILE__, 'partner_section');
    add_settings_field('related_number_of_posts_ext', __('<b>Maximum</b> number of related posts to display from this site\'s blogroll', 'nrelate'), 'setting_related_number_of_posts_nr_rc_ext', __FILE__, 'partner_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'partner_section');
    // Layout Section
    add_settings_section('layout_section', __('Layout Settings', 'nrelate'), 'section_text_nr_rc_layout', __FILE__);
    add_settings_field('related_where_to_show', __('Which pages should display related content?' . nrelate_tooltip('_where_to_show') . '<p>You can read about these options at the <a href="http://codex.wordpress.org/Conditional_Tags">WordPress Codex</a>', 'nrelate'), 'setting_related_where_to_show', __FILE__, 'layout_section');
    add_settings_field('related_loc_top', __('Top of post <em>(Automatic)</em>' . nrelate_tooltip('_loc_top'), 'nrelate'), 'setting_related_loc_top', __FILE__, 'layout_section');
    add_settings_field('related_loc_bottom', __('Bottom of post <em>(Automatic)</em>' . nrelate_tooltip('_loc_bottom'), 'nrelate'), 'setting_related_loc_bottom', __FILE__, 'layout_section');
    add_settings_field('related_loc_widget', __('Widget area or Sidebar <em>(Automatic)</em>', 'nrelate'), 'nrelate_text_widget_page', __FILE__, 'layout_section');
    add_settings_field('related_loc_manual', __('<span id="loc_manual">Add to Theme <em>(Manual)</em><span>', 'nrelate'), 'setting_related_manual', __FILE__, 'layout_section');
    add_settings_field('related_css_link', __('Change the Style', 'nrelate', 'nrelate'), 'setting_related_css_link', __FILE__, 'layout_section');
    add_settings_field('related_display_logo', __('Would you like to support nrelate by displaying our logo?', 'nrelate'), 'setting_related_display_logo', __FILE__, 'layout_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'layout_section');
    // Labs Section
    add_settings_section('labs_section', __('nrelate Labs', 'nrelate'), 'nrelate_text_labs', __FILE__);
    add_settings_field('related_nonjs', __('Which nrelate version would you like to use?', 'nrelate'), 'setting_related_nonjs', __FILE__, 'labs_section');
    // Reset Setting
    add_settings_section('reset_section', __('Reset Settings to Default', 'nrelate'), 'nrelate_text_reset', __FILE__);
    add_settings_field('related_reset', __('Would you like to restore to defaults upon reactivation?', 'nrelate'), 'setting_reset_nr_rc', __FILE__, 'reset_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'reset_section');
}
/**
 * nrelate Most Popular Advertising Settings
 *
 * @package nrelate
 * @subpackage Functions
 */
function options_init_nr_mp_ads()
{
    register_setting('nrelate_popular_options_ads', 'nrelate_popular_options_ads', 'popular_adv_options_validate');
    $options = get_option('nrelate_popular_options_ads');
    // Div style on initial load for showing ad_title
    $divstyle = $options['popular_ad_placement'] == "Separate" ? 'style="display:block;"' : 'style="display:none;"';
    // Ad Section
    add_settings_section('ad_section', __('Advertising Settings', 'nrelate'), 'nrelate_text_advertising', __FILE__);
    add_settings_field('popular_display_ad_image', '', 'popular_display_ad_money', __FILE__, 'ad_section');
    add_settings_field('popular_paypal_email', __('Advertising payments.', 'nrelate'), 'setting_adv_ppemail_mp', __FILE__, 'ad_section');
    add_settings_field('popular_display_ad', __('Would you like to display ads?', 'nrelate'), 'setting_adv_display_ad_mp', __FILE__, 'ad_section');
    add_settings_field('popular_ad_number', __('How many ad spaces do you wish to show?', 'nrelate'), 'setting_adv_ad_number_mp', __FILE__, 'ad_section');
    add_settings_field('popular_ad_placement', __('Where would you like to place the ads?', 'nrelate') . nrelate_tooltip('_adplacement'), 'setting_adv_ad_placement_mp', __FILE__, 'ad_section');
    add_settings_field('popular_ad_title', __('<div class="nr_separate_ad_opt" ' . $divstyle . '>Please enter a title for advertising section</div>', 'nrelate'), 'setting_adv_ad_title_mp', __FILE__, 'ad_section');
    add_settings_field('popular_ad_animation', __('Would you like to show animated "sponsored" text in ads?', 'nrelate'), 'setting_adv_ad_animation_mp', __FILE__, 'ad_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'ad_section');
}
Пример #3
0
/**
 * nrelate Flyout Settings
 *
 * @package nrelate
 * @subpackage Functions
 */
function options_init_nr_fo()
{
    register_setting('nrelate_flyout_options', 'nrelate_flyout_options', 'flyout_options_validate');
    $options = get_option('nrelate_flyout_options');
    // Display preview image
    if ($options['flyout_thumbnail'] == "Thumbnails") {
        $divstyle = 'style="display:block;"';
    } else {
        $divstyle = 'style="display:none;"';
    }
    if (isset($options['flyout_offset']) && $options['flyout_offset'] == 4) {
        $offset_divstyle = 'style="display:block;"';
    } else {
        $offset_divstyle = 'style="display:none;"';
    }
    if (isset($options['flyout_show_post_title']) && $options['flyout_show_post_title'] == 'on') {
        $showpost_divstyle = 'style="display:block;"';
    } else {
        $showpost_divstyle = 'style="display:none;"';
    }
    if (isset($options['flyout_show_post_excerpt']) && $options['flyout_show_post_excerpt'] == 'on') {
        $showexcerpt_divstyle = 'style="display:block;"';
    } else {
        $showexcerpt_divstyle = 'style="display:none;"';
    }
    // Main Section
    add_settings_section('main_section', __('Main Settings', 'nrelate'), 'section_text_nr_fo', __FILE__);
    add_settings_field('flyout_save_preview_top', '', 'nrelate_save_preview', __FILE__, 'main_section');
    add_settings_field('flyout_thumbnail', __('Would you like to display thumbnails with text, or text only', 'nrelate') . nrelate_tooltip('_thumbnail'), 'setting_flyout_thumbnail', __FILE__, 'main_section');
    add_settings_field('flyout_thumbnail_size', __('<div class="nr_image_option" ' . $divstyle . '>Please choose a thumbnail size', 'nrelate') . nrelate_tooltip('_thumbnail_size') . '</div>', 'setting_flyout_thumbnail_size', __FILE__, 'main_section');
    add_settings_field('flyout_default_image', __('<div class="nr_image_option" ' . $divstyle . '>Please provide a link to your default image: (This will show up when a flyout post does not have a picture in it)<br/><i>For best results image should be as large (or larger) than the thumbnail size you chose above.</i>', 'nrelate') . nrelate_tooltip('_default_image') . "</div>", 'setting_flyout_default_image', __FILE__, 'main_section');
    add_settings_field('flyout_custom_field', __('<div class="nr_image_option" ' . $divstyle . '>If you use <b>Custom Fields</b> for your images, nrelate can show them.</div>', 'nrelate'), 'setting_flyout_custom_field', __FILE__, 'main_section');
    add_settings_field('flyout_title', __('Please enter a title for the flyout content box', 'nrelate') . nrelate_tooltip('_title'), 'setting_string_nr_fo', __FILE__, 'main_section');
    add_settings_field('flyout_number_of_posts', __('<b>Maximum</b> number of posts to display from this site</br><em>To display multiple rows of thumbnails, choose more than will fit in one row.</em>', 'nrelate') . nrelate_tooltip('_number_of_posts'), 'setting_flyout_number_of_posts_nr_fo', __FILE__, 'main_section');
    add_settings_field('flyout_bar', __('How relevant do you want the results to be?<br/><i>Based on the amount/type of content on your website, medium and high relevancy settings may return little or no posts.</i>', 'nrelate'), 'setting_flyout_bar_nr_fo', __FILE__, 'main_section');
    add_settings_field('flyout_max_age', __('How deep into your archive would you like to go for flyout posts?', 'nrelate') . nrelate_tooltip('_max_age'), 'setting_flyout_max_age', __FILE__, 'main_section');
    add_settings_field('flyout_exclude_cats', __('Exclude Categories from your flyout content.', 'nrelate') . nrelate_tooltip('_exclude_cats'), 'nrelate_text_exclude_categories', __FILE__, 'main_section');
    add_settings_field('flyout_show_post_title', '<a name="nrelate_show_post_title"></a>' . __('Show Post Title?', 'nrelate') . nrelate_tooltip('_show_post_title'), 'setting_flyout_show_post_title', __FILE__, 'main_section');
    add_settings_field('flyout_max_chars_per_line', __('<div class="nr_showpost_option" ' . $showpost_divstyle . '>Maximum number of characters for title?', 'nrelate') . nrelate_tooltip('_max_chars_per_line') . '</div>', 'setting_flyout_max_chars_per_line', __FILE__, 'main_section');
    add_settings_field('flyout_show_post_excerpt', '<a name="nrelate_show_post_excerpt"></a>' . __('Show Post Excerpt?', 'nrelate') . nrelate_tooltip('_show_post_excerpt'), 'setting_flyout_show_post_excerpt', __FILE__, 'main_section');
    add_settings_field('flyout_max_chars_post_excerpt', __('<div class="nr_showexcerpt_option" ' . $showexcerpt_divstyle . '>Maximum number of words for post excerpt?', 'nrelate') . nrelate_tooltip('_max_chars_post_excerpt') . '</div>', 'setting_flyout_max_chars_post_excerpt', __FILE__, 'main_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'main_section');
    // Layout Section
    add_settings_section('layout_section', __('Layout Settings', 'nrelate'), 'section_text_nr_fo_layout', __FILE__);
    //add_settings_field('flyout_where_to_show',__('Which pages should display flyout content?<p>You can read about these options at the <a href="http://codex.wordpress.org/Conditional_Tags">WordPress Codex</a>','nrelate'), 'setting_flyout_where_to_show', __FILE__, 'layout_section');
    add_settings_field('flyout_loc', __('Which side of the page should the box appear from?', 'nrelate'), 'setting_flyout_loc', __FILE__, 'layout_section');
    add_settings_field('flyout_animation', __('Choose an Animation type,', 'nrelate') . '<br><a href="admin.php?page=nrelate-flyout&tab=anim-styles">' . __('then an animation style', 'nrelate') . '</a>', 'setting_flyout_animation', __FILE__, 'layout_section');
    add_settings_field('flyout_offset', __('When should the Flyout appear?', 'nrelate'), 'setting_flyout_offset', __FILE__, 'layout_section');
    add_settings_field('flyout_offset_element', '<div id="flyout_offset_div_header" ' . $offset_divstyle . '>' . __('Before which HTML element should the box appear? (i.e. #comments, .entry-content)', 'nrelate') . '</div>', 'setting_flyout_offset_element', __FILE__, 'layout_section');
    add_settings_field('flyout_width', __('Width of Flyout box:', 'nrelate'), 'setting_flyout_width', __FILE__, 'layout_section');
    add_settings_field('flyout_from_bot', __('How far from the bottom of the screen do you want the box to appear?', 'nrelate'), 'setting_flyout_from_bot', __FILE__, 'layout_section');
    add_settings_field('flyout_css_link', __('Change the Style', 'nrelate', 'nrelate'), 'setting_flyout_css_link', __FILE__, 'layout_section');
    add_settings_field('flyout_display_logo', __('Would you like to support nrelate by displaying our logo?', 'nrelate'), 'setting_flyout_display_logo', __FILE__, 'layout_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'layout_section');
    // Labs Section
    add_settings_section('labs_section', __('nrelate Labs', 'nrelate'), 'nrelate_text_labs', __FILE__);
    add_settings_field('flyout_nonjs', __('Which nrelate version would you like to use?', 'nrelate'), 'setting_flyout_nonjs', __FILE__, 'labs_section');
    // Reset Setting
    add_settings_section('reset_section', __('Reset Settings to Default', 'nrelate'), 'nrelate_text_reset', __FILE__);
    add_settings_field('flyout_reset', __('Would you like to restore to defaults upon reactivation?', 'nrelate'), 'setting_reset_nr_fo', __FILE__, 'reset_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'reset_section');
}
/**
 * nrelate Most Popular Settings
 *
 * @package nrelate
 * @subpackage Functions
 */
function options_init_nr_mp()
{
    register_setting('nrelate_popular_options', 'nrelate_popular_options', 'popular_options_validate');
    $options = get_option('nrelate_popular_options');
    // Display preview image
    if ($options['popular_thumbnail'] == "Thumbnails") {
        $divstyle = 'style="display:block;"';
    } else {
        $divstyle = 'style="display:none;"';
    }
    if (isset($options['popular_show_post_title']) && $options['popular_show_post_title'] == 'on') {
        $showpost_divstyle = 'style="display:block;"';
    } else {
        $showpost_divstyle = 'style="display:none;"';
    }
    if (isset($options['popular_show_post_excerpt']) && $options['popular_show_post_excerpt'] == 'on') {
        $showexcerpt_divstyle = 'style="display:block;"';
    } else {
        $showexcerpt_divstyle = 'style="display:none;"';
    }
    if (isset($options['popular_showviews']) && $options['popular_showviews'] == 'on') {
        $showview_divstyle = 'style="display:block;"';
    } else {
        $showview_divstyle = 'style="display:none;"';
    }
    // Main Section
    add_settings_section('main_section', __('Main Settings', 'nrelate'), 'section_text_nr_mp', __FILE__);
    add_settings_field('popular_save_preview_top', '', 'nrelate_save_preview', __FILE__, 'main_section');
    add_settings_field('popular_thumbnail', __('Would you like to display thumbnails with text, or text only', 'nrelate') . nrelate_tooltip('_thumbnail'), 'setting_popular_thumbnail', __FILE__, 'main_section');
    add_settings_field('popular_thumbnail_size', __('<div class="nr_image_option" ' . $divstyle . '>Please choose a thumbnail size', 'nrelate') . nrelate_tooltip('_thumbnail_size') . '</div>', 'setting_popular_thumbnail_size', __FILE__, 'main_section');
    add_settings_field('popular_default_image', __('<div class="nr_image_option" ' . $divstyle . '>Please provide a link to your default image: (This will show up when a popular post does not have a picture in it)<br/><i>For best results image should be as large (or larger) than the thumbnail size you chose above.</i>' . nrelate_tooltip('_default_image') . '</div>', 'nrelate'), 'setting_popular_default_image', __FILE__, 'main_section');
    add_settings_field('popular_custom_field', __('<div class="nr_image_option" ' . $divstyle . '>If you use <b>Custom Fields</b> for your images, nrelate can show them.</div>', 'nrelate'), 'setting_popular_custom_field', __FILE__, 'main_section');
    add_settings_field('popular_title', __('Please enter a title for the popular content box', 'nrelate') . nrelate_tooltip('_title'), 'setting_string_nr_mp', __FILE__, 'main_section');
    add_settings_field('popular_number_of_posts', __('<b>Maximum</b> number of popular posts to display from this site', 'nrelate') . nrelate_tooltip('_number_of_posts'), 'setting_popular_number_of_posts_nr_mp', __FILE__, 'main_section');
    add_settings_field('popular_max_age', __('Show the most popular posts for the selected time period.<br/>(note: we can only begin tracking from your install date) ', 'nrelate') . nrelate_tooltip('_mp_max_age'), 'setting_popular_max_age', __FILE__, 'main_section');
    add_settings_field('popular_exclude_cats', __('Exclude Categories from your popular content.', 'nrelate') . nrelate_tooltip('_exclude_cats'), 'nrelate_text_exclude_categories', __FILE__, 'main_section');
    add_settings_field('popular_show_post_title', '<a name="nrelate_show_post_title"></a>' . __('Show Post Title?', 'nrelate') . nrelate_tooltip('_show_post_title'), 'setting_popular_show_post_title', __FILE__, 'main_section');
    add_settings_field('popular_max_chars_per_line', __('<div class="nr_showpost_option" ' . $showpost_divstyle . '>Maximum number of characters for title?', 'nrelate') . nrelate_tooltip('_max_chars_per_line') . '</div>', 'setting_popular_max_chars_per_line', __FILE__, 'main_section');
    add_settings_field('popular_show_post_excerpt', '<a name="nrelate_show_post_excerpt"></a>' . __('Show Post Excerpt?', 'nrelate') . nrelate_tooltip('_show_post_excerpt'), 'setting_popular_show_post_excerpt', __FILE__, 'main_section');
    add_settings_field('popular_max_chars_post_excerpt', __('<div class="nr_showexcerpt_option" ' . $showexcerpt_divstyle . '>Maximum number of words for post excerpt?', 'nrelate') . nrelate_tooltip('_max_chars_post_excerpt') . '</div>', 'setting_popular_max_chars_post_excerpt', __FILE__, 'main_section');
    add_settings_field('popular_showviews', __('Show View Count?', 'nrelate'), 'setting_show_views', __FILE__, 'main_section');
    add_settings_field('popular_view', __('<div class="nr_showview_option" ' . $showview_divstyle . '>Please enter a title for the "views" box', 'nrelate') . '</div>', 'setting_views', __FILE__, 'main_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'main_section');
    // Layout Section
    add_settings_section('layout_section', __('Layout Settings', 'nrelate'), 'section_text_nr_mp_layout', __FILE__);
    add_settings_field('popular_where_to_show', __('Which pages should display popular content?' . nrelate_tooltip('_where_to_show') . '<p>You can read about these options at the <a href="http://codex.wordpress.org/Conditional_Tags">WordPress Codex</a>', 'nrelate'), 'setting_popular_where_to_show', __FILE__, 'layout_section');
    add_settings_field('popular_loc_top', __('Top of post <em>(Automatic)</em>' . nrelate_tooltip('_loc_top'), 'nrelate'), 'setting_popular_loc_top', __FILE__, 'layout_section');
    add_settings_field('popular_loc_bottom', __('Bottom of post <em>(Automatic)</em>' . nrelate_tooltip('_loc_bottom'), 'nrelate'), 'setting_popular_loc_bottom', __FILE__, 'layout_section');
    add_settings_field('popular_loc_widget', __('Widget area or Sidebar <em>(Automatic)</em>', 'nrelate'), 'nrelate_text_widget_page', __FILE__, 'layout_section');
    add_settings_field('popular_loc_manual', __('<span id="loc_manual">Add to Theme <em>(Manual)</em></span>', 'nrelate'), 'setting_popular_manual', __FILE__, 'layout_section');
    add_settings_field('popular_css_link', __('Change the Style', 'nrelate', 'nrelate'), 'setting_popular_css_link', __FILE__, 'layout_section');
    add_settings_field('popular_display_logo', __('Would you like to support nrelate by displaying our logo?', 'nrelate'), 'setting_popular_display_logo', __FILE__, 'layout_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'layout_section');
    // Labs Section
    add_settings_section('labs_section', __('nrelate Labs', 'nrelate'), 'nrelate_text_labs', __FILE__);
    add_settings_field('popular_nonjs', __('Which nrelate version would you like to use?', 'nrelate'), 'setting_popular_nonjs', __FILE__, 'labs_section');
    // Reset Setting
    add_settings_section('reset_section', __('Reset Settings to Default', 'nrelate'), 'nrelate_text_reset', __FILE__);
    add_settings_field('popular_reset', __('Would you like to restore to defaults upon reactivation?', 'nrelate'), 'setting_reset_nr_mp', __FILE__, 'reset_section');
    add_settings_field('nrelate_save_preview', '', 'nrelate_save_preview', __FILE__, 'reset_section');
}
Пример #5
0
 function start_el(&$output, $category, $depth = 0, $args = array(), $current_object_id = 0)
 {
     extract($args);
     if (empty($taxonomy)) {
         $taxonomy = 'category';
     }
     $name = isset($name) ? $name : 'nrelate_admin_options[admin_exclude_categories]';
     $value_field = isset($value_field) ? $value_field : 'term_id';
     $css_classes = !$category->parent ? ' top-level-category' : '';
     $css_classes .= $has_children ? ' parent-category' : '';
     $css_classes .= in_array($category->{$value_field}, $selected_cats) ? ' excluded-category' : '';
     $class = $css_classes ? "class='{$css_classes}'" : '';
     // Supports WP v2.9
     $output .= "\n<li id='{$taxonomy}-{$category->term_id}'{$class}>" . '<label class="selectit"><input value="' . $category->{$value_field} . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' . checked(in_array($category->{$value_field}, $selected_cats), true, false) . ' /> ' . esc_html(apply_filters('the_category', $category->name)) . nrelate_tooltip("_{$category->{$value_field}}") . '</label>';
 }