Plugin Directory

Changeset 3280416


Ignore:
Timestamp:
04/24/2025 02:12:03 AM (10 months ago)
Author:
daisyplugins
Message:

v1.0.4

Location:
daisy-titles
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • daisy-titles/trunk/daisy-titles.php

    r3277788 r3280416  
    33 * Plugin Name:         Daisy Titles
    44 * Plugin URI:          https://wordpress.org/plugins/daisy-titles
    5  * Description:        Customize titles with colors, sizes, and fonts. Hide titles on posts and pages.
    6  * Version:             1.0.3
     5 * Description:        Customize titles with colors, sizes, and fonts. Optionally hide titles on posts and pages.
     6 * Version:             1.0.4
    77 * Requires at least:   5.2
    88 * Requires PHP:        7.2
     
    2020
    2121// Define constants
    22 define('DAISY_TITLES_VERSION', '1.0.3');
     22define('DAISY_TITLES_VERSION', '1.0.4');
    2323define('DAISY_TITLES_PLUGIN_URL', plugin_dir_url(__FILE__));
    2424define('DAISY_TITLES_PLUGIN_PATH', plugin_dir_path(__FILE__));
     
    2727add_action('admin_menu', 'daisy_titles_add_admin_menu');
    2828function daisy_titles_add_admin_menu() {
    29     add_options_page(
    30         __('Daisy Titles Settings', 'daisy-titles'),
    31         __('Daisy Titles', 'daisy-titles'),
    32         'manage_options',
    33         'daisy-titles',
    34         'daisy_titles_options_page'
    35     );
     29    // Add main menu page
     30    add_menu_page(
     31        __('Daisy Titles Settings', 'daisy-titles'),  // Page title
     32        __('Daisy Titles', 'daisy-titles'),           // Menu title
     33        'manage_options',                             // Capability
     34        'daisy-titles',                               // Menu slug
     35        'daisy_titles_options_page',                  // Callback function
     36        'dashicons-edit',                             // Icon (using dashicon)
     37        80                                            // Position (below Settings)
     38    );
     39   
     40    // Remove the duplicate submenu that WordPress adds by default
     41    remove_submenu_page('daisy-titles', 'daisy-titles');
    3642}
    3743
     
    4854    );
    4955
    50 
    51 
    5256    // Title visibility section
    5357    add_settings_section(
    5458        'daisy_titles_visibility_section',
    55         __('Title Visibility Options', 'daisy-titles'),
     59        __('Title Visibility (on Single View)', 'daisy-titles'),
    5660        'daisy_titles_visibility_section_callback',
    5761        'daisy_titles_plugin'
     
    7680    );
    7781
    78 
    79 
    80 
    8182    // Main settings section
    8283    add_settings_section(
    8384        'daisy_titles_main_section',
    84         __('<hr><br>Title Styling Options', 'daisy-titles'),
     85        __('<hr><br>Title Styling (on Single View)', 'daisy-titles'),
    8586        'daisy_titles_section_callback',
    8687        'daisy_titles_plugin'
     88    );
     89
     90    // Title Styling Toggle
     91    add_settings_field(
     92        'daisy_titles_enable_styling',
     93        __('Enable Styling', 'daisy-titles'),
     94        'daisy_titles_enable_styling_render',
     95        'daisy_titles_plugin',
     96        'daisy_titles_main_section'
    8797    );
    8898
     
    114124    );
    115125
     126    // // Font weight field
     127    // add_settings_field(
     128    //     'daisy_titles_font_weight',
     129    //     __('Font Weight', 'daisy-titles'),
     130    //     'daisy_titles_font_weight_render',
     131    //     'daisy_titles_plugin',
     132    //     'daisy_titles_main_section'
     133    // );
     134
     135    // // Text transform field
     136    // add_settings_field(
     137    //     'daisy_titles_text_transform',
     138    //     __('Text Transform', 'daisy-titles'),
     139    //     'daisy_titles_text_transform_render',
     140    //     'daisy_titles_plugin',
     141    //     'daisy_titles_main_section'
     142    // );
     143
     144    // Letter spacing field
     145    // add_settings_field(
     146    //     'daisy_titles_letter_spacing',
     147    //     __('Letter Spacing (px)', 'daisy-titles'),
     148    //     'daisy_titles_letter_spacing_render',
     149    //     'daisy_titles_plugin',
     150    //     'daisy_titles_main_section'
     151    // );
     152
     153    // // Line height field
     154    // add_settings_field(
     155    //     'daisy_titles_line_height',
     156    //     __('Line Height', 'daisy-titles'),
     157    //     'daisy_titles_line_height_render',
     158    //     'daisy_titles_plugin',
     159    //     'daisy_titles_main_section'
     160    // );
     161
    116162    // Apply to field
    117163    add_settings_field(
     
    122168        'daisy_titles_main_section'
    123169    );
    124 
    125 
    126170}
    127171
    128172// Section callback
    129173function daisy_titles_section_callback() {
    130     esc_html_e('Customize how your post titles appear on the front-end.', 'daisy-titles');
     174    esc_html_e('Customize how your post titles appear on the single view.', 'daisy-titles');
    131175}
    132176
    133177// Visibility section callback
    134178function daisy_titles_visibility_section_callback() {
    135     esc_html_e('Control the visibility of titles globally. Individual post settings will override these options.', 'daisy-titles');
     179    esc_html_e('Control the visibility of titles globally. These options will override individual post settings.', 'daisy-titles');
     180}
     181
     182// Enable styling toggle render
     183function daisy_titles_enable_styling_render() {
     184    $options = get_option('daisy_titles_settings');
     185    ?>
     186    <label class="daisy-switch">
     187        <input type="checkbox" id="daisy_titles_enable_styling" name="daisy_titles_settings[daisy_titles_enable_styling]" value="1" <?php checked(isset($options['daisy_titles_enable_styling']) && $options['daisy_titles_enable_styling']); ?>>
     188        <span class="daisy-slider daisy-round"></span>
     189    </label>
     190    <script>
     191    jQuery(document).ready(function($) {
     192        // Show/hide styling options based on toggle state
     193        function toggleStylingOptions() {
     194            if ($('#daisy_titles_enable_styling').is(':checked')) {
     195                $('.daisy-styling-option').show();
     196            } else {
     197                $('.daisy-styling-option').hide();
     198            }
     199        }
     200       
     201        // Initial state
     202        toggleStylingOptions();
     203       
     204        // On change
     205        $('#daisy_titles_enable_styling').change(function() {
     206            toggleStylingOptions();
     207        });
     208    });
     209    </script>
     210    <?php
    136211}
    137212
     
    140215    $options = get_option('daisy_titles_settings');
    141216    ?>
    142     <input type="color" name="daisy_titles_settings[daisy_titles_color]" value="<?php echo esc_attr($options['daisy_titles_color'] ?? '#333333'); ?>">
     217    <div class="daisy-styling-option">
     218        <input type="color" name="daisy_titles_settings[daisy_titles_color]" value="<?php echo esc_attr($options['daisy_titles_color'] ?? '#333333'); ?>">
     219    </div>
    143220    <?php
    144221}
     
    148225    $options = get_option('daisy_titles_settings');
    149226    ?>
    150     <input type="number" name="daisy_titles_settings[daisy_titles_font_size]" min="10" max="72" value="<?php echo esc_attr($options['daisy_titles_font_size'] ?? '24'); ?>"> px
     227    <div class="daisy-styling-option">
     228        <input type="number" name="daisy_titles_settings[daisy_titles_font_size]" min="10" max="100" value="<?php echo esc_attr($options['daisy_titles_font_size'] ?? '24'); ?>"> px
     229    </div>
    151230    <?php
    152231}
     
    158237        'Arial, sans-serif' => 'Arial',
    159238        'Helvetica, sans-serif' => 'Helvetica',
    160         'Times New Roman, serif' => 'Times New Roman',
    161         'Georgia, serif' => 'Georgia',
    162         'Courier New, monospace' => 'Courier New',
    163         'Verdana, sans-serif' => 'Verdana'
    164     );
    165     ?>
    166     <select name="daisy_titles_settings[daisy_titles_font_family]">
    167         <?php foreach ($fonts as $value => $label) : ?>
    168             <option value="<?php echo esc_attr($value); ?>" <?php selected($options['daisy_titles_font_family'] ?? '', $value); ?>>
    169                 <?php echo esc_html($label); ?>
    170             </option>
    171         <?php endforeach; ?>
    172     </select>
    173     <?php
    174 }
     239        'Times New Roman, serif' => 'Times New Roman'
     240    );
     241    ?>
     242    <div class="daisy-styling-option">
     243        <select name="daisy_titles_settings[daisy_titles_font_family]">
     244            <?php foreach ($fonts as $value => $label) : ?>
     245                <option value="<?php echo esc_attr($value); ?>" <?php selected($options['daisy_titles_font_family'] ?? '', $value); ?>>
     246                    <?php echo esc_html($label); ?>
     247                </option>
     248            <?php endforeach; ?>
     249        </select>
     250    </div>
     251    <?php
     252}
     253
     254// Font weight field render
     255function daisy_titles_font_weight_render() {
     256    $options = get_option('daisy_titles_settings');
     257    $weights = array(
     258        'normal' => 'Normal',
     259        'bold' => 'Bold',
     260        'bolder' => 'Bolder',
     261        'lighter' => 'Lighter',
     262        '100' => '100 (Thin)',
     263        '200' => '200 (Extra Light)',
     264        '300' => '300 (Light)',
     265        '400' => '400 (Regular)',
     266        '500' => '500 (Medium)',
     267        '600' => '600 (Semi Bold)',
     268        '700' => '700 (Bold)',
     269        '800' => '800 (Extra Bold)',
     270        '900' => '900 (Black)'
     271    );
     272    ?>
     273<!--     <div class="daisy-styling-option">
     274        <select name="daisy_titles_settings[daisy_titles_font_weight]">
     275            <?php foreach ($weights as $value => $label) : ?>
     276                <option value="<?php echo esc_attr($value); ?>" <?php selected($options['daisy_titles_font_weight'] ?? 'normal', $value); ?>>
     277                    <?php echo esc_html($label); ?>
     278                </option>
     279            <?php endforeach; ?>
     280        </select>
     281    </div> -->
     282    <?php
     283}
     284
     285// Text transform field render
     286function daisy_titles_text_transform_render() {
     287    $options = get_option('daisy_titles_settings');
     288    $transforms = array(
     289        'none' => 'None',
     290        'capitalize' => 'Capitalize',
     291        'uppercase' => 'Uppercase',
     292        'lowercase' => 'Lowercase'
     293    );
     294    ?>
     295<!--     <div class="daisy-styling-option">
     296        <select name="daisy_titles_settings[daisy_titles_text_transform]">
     297            <?php foreach ($transforms as $value => $label) : ?>
     298                <option value="<?php echo esc_attr($value); ?>" <?php selected($options['daisy_titles_text_transform'] ?? 'none', $value); ?>>
     299                    <?php echo esc_html($label); ?>
     300                </option>
     301            <?php endforeach; ?>
     302        </select>
     303    </div> -->
     304    <?php
     305}
     306
     307// Letter spacing field render
     308function daisy_titles_letter_spacing_render() {
     309    $options = get_option('daisy_titles_settings');
     310    ?>
     311<!--     <div class="daisy-styling-option">
     312        <input type="number" name="daisy_titles_settings[daisy_titles_letter_spacing]" min="-5" max="10" step="0.1" value="<?php echo esc_attr($options['daisy_titles_letter_spacing'] ?? '0'); ?>"> px
     313    </div> -->
     314    <?php
     315}
     316
     317 // Line height field render
     318 function daisy_titles_line_height_render() {
     319     $options = get_option('daisy_titles_settings');
     320     ?>
     321<!--      <div class="daisy-styling-option">
     322         <input type="number" name="daisy_titles_settings[daisy_titles_line_height]" min="0.5" max="3" step="0.1" value="<?php echo esc_attr($options['daisy_titles_line_height'] ?? '1.2'); ?>">
     323     </div> -->
     324     <?php
     325 }
    175326
    176327// Apply to field render
     
    179330    $post_types = get_post_types(array('public' => true), 'objects');
    180331    $current_types = isset($options['daisy_titles_apply_to']) ? (array)$options['daisy_titles_apply_to'] : array('post', 'page');
    181    
    182     foreach ($post_types as $post_type) {
    183         if ($post_type->name === 'attachment') continue;
    184         ?>
    185         <label>
    186             <input type="checkbox" name="daisy_titles_settings[daisy_titles_apply_to][]" value="<?php echo esc_attr($post_type->name); ?>"
    187                 <?php checked(in_array($post_type->name, $current_types)); ?>>
    188             <?php echo esc_html($post_type->labels->name); ?>
    189         </label><br>
    190         <?php
    191     }
     332    ?>
     333    <div class="daisy-styling-option">
     334        <?php foreach ($post_types as $post_type) : ?>
     335            <?php if ($post_type->name === 'attachment') continue; ?>
     336            <label>
     337                <input type="checkbox" name="daisy_titles_settings[daisy_titles_apply_to][]" value="<?php echo esc_attr($post_type->name); ?>"
     338                    <?php checked(in_array($post_type->name, $current_types)); ?>>
     339                <?php echo esc_html($post_type->labels->name); ?>
     340            </label><br>
     341        <?php endforeach; ?>
     342    </div>
     343    <?php
    192344}
    193345
     
    222374    ?>
    223375    <div class="wrap daisy-titles-admin">
    224         <div class="daisy-header">
    225             <h1><span class="daisy-icon">🌼</span> <?php echo esc_html(get_admin_page_title()); ?></h1>
    226             <p class="daisy-description"><?php esc_html_e('Customize your titles with beautiful styles and visibility options', 'daisy-titles'); ?></p>
     376
     377
     378        <div class="daisy-titles-header">
     379            <div class="daisy-titles-title-section">
     380                <h1><?php esc_html_e('Daisy Titles', 'daisy-titles'); ?></h1>
     381            </div>
     382            <div class="daisy-titles-logo">
     383                <span class="dashicons dashicons-edit-large"></span>
     384            </div>
    227385        </div>
     386
     387
    228388       
    229389        <div class="daisy-content-wrap">
    230390            <div class="daisy-settings-card">
     391                    <div class="daisy-titles-card-header">
     392                        <h3><span class="dashicons dashicons-edit-large"></span> <?php esc_html_e('Setting Options', 'daisy-titles'); ?></h3>
     393                    </div>
     394                    <div class="daisy-titles-card-body">
    231395                <form action="options.php" method="post">
    232396                    <?php
     
    237401                </form>
    238402            </div>
     403            </div>
    239404           
    240             <div class="daisy-sidebar">
    241                 <div class="daisy-card">
    242                     <h3><?php esc_html_e('Need Help?', 'daisy-titles'); ?></h3>
    243                     <p><?php esc_html_e('Check out our documentation or contact support if you have any questions.', 'daisy-titles'); ?></p>
    244                     <a href="https://wordpress.org/support/plugin/daisy-titles/" class="button" target="_blank"><?php esc_html_e('Get Support', 'daisy-titles'); ?></a>
     405            <div class="daisy-titles-sidebar">
     406
     407
     408
     409                <div class="daisy-titles-card">
     410                    <div class="daisy-titles-card-header">
     411                        <h3><span class="dashicons dashicons-info"></span> <?php esc_html_e('About Plugin', 'daisy-titles'); ?></h3>
     412                    </div>
     413                    <div class="daisy-titles-card-body">
     414                        <div class="daisy-titles-info-item">
     415                            <h4><span class="dashicons dashicons-admin-plugins"></span> <?php esc_html_e('Version', 'daisy-titles'); ?></h4>
     416                            <p>1.0.4</p>
     417                        </div>
     418                        <div class="daisy-titles-info-item">
     419                            <h4><span class="dashicons dashicons-calendar-alt"></span> <?php esc_html_e('Release Date', 'daisy-titles'); ?></h4>
     420                            <p>April 24, 2025</p>
     421                        </div>
     422                        <div class="daisy-titles-info-item">
     423                            <h4><span class="dashicons dashicons-admin-users"></span> <?php esc_html_e('Author', 'daisy-titles'); ?></h4>
     424                            <p><a href="https://profiles.wordpress.org/daisyplugins/" target="_blank" style="text-decoration: none;">DaisyPlugins</a></p>
     425                        </div>
     426                        <div class="daisy-titles-info-item">
     427                            <h4><span class="dashicons dashicons-admin-site-alt3"></span> <?php esc_html_e('Blog', 'daisy-titles'); ?></h4>
     428                            <p><a href="https://daisywp.com" target="_blank" style="text-decoration: none;">DaisyWP</a></p>
     429                        </div>
     430                    </div>
     431                </div>
     432
     433
     434                <div class="daisy-titles-card">
     435                    <div class="daisy-titles-card-header">
     436                        <h3><span class="dashicons dashicons-testimonial"></span> <?php esc_html_e('Need Help?', 'daisy-titles'); ?></h3>
     437                    </div>
     438                    <div class="daisy-titles-card-body">
     439                        <p><?php esc_html_e('Check out our documentation or contact support if you have any questions.', 'daisy-titles'); ?></p>
     440                        <a href="https://wordpress.org/support/plugin/daisy-titles/" class="button" target="_blank"><?php esc_html_e('Get Support', 'daisy-titles'); ?></a>
     441                    </div>
    245442                </div>
    246443               
    247                 <div class="daisy-card">
    248                     <h3><?php esc_html_e('Like This Plugin?', 'daisy-titles'); ?></h3>
    249                     <p><?php esc_html_e('Please consider leaving a review on WordPress.org.', 'daisy-titles'); ?></p>
    250                     <a href="https://wordpress.org/support/plugin/daisy-titles/reviews/" class="button" target="_blank"><?php esc_html_e('Leave a Review', 'daisy-titles'); ?></a>
     444                <div class="daisy-titles-card">
     445                    <div class="daisy-titles-card-header">
     446                        <h3><span class="dashicons dashicons-thumbs-up"></span> <?php esc_html_e('Like This Plugin?', 'daisy-titles'); ?></h3>
     447                    </div>
     448
     449                    <div class="daisy-titles-card-body">
     450                        <p><?php esc_html_e('Please consider leaving a review on WordPress.org.', 'daisy-titles'); ?></p>
     451                        <a href="https://wordpress.org/support/plugin/daisy-titles/reviews/?filter=5#new-post" class="button" target="_blank"><?php esc_html_e('Leave a Review', 'daisy-titles'); ?></a>
     452                    </div>
    251453                </div>
     454
     455
     456
     457
     458
    252459            </div>
    253460        </div>
     
    261468    $sanitized = array();
    262469   
     470    // Sanitize enable styling toggle
     471    if (isset($new_settings['daisy_titles_enable_styling'])) {
     472        $sanitized['daisy_titles_enable_styling'] = (bool)$new_settings['daisy_titles_enable_styling'];
     473    }
     474
    263475    // Sanitize color
    264476    if (isset($new_settings['daisy_titles_color'])) {
     
    269481    if (isset($new_settings['daisy_titles_font_size'])) {
    270482        $size = intval($new_settings['daisy_titles_font_size']);
    271         $sanitized['daisy_titles_font_size'] = max(10, min(72, $size)); // Clamp between 10 and 72
     483        $sanitized['daisy_titles_font_size'] = max(10, min(100, $size)); // Clamp between 10 and 100
    272484    }
    273485   
     
    280492            'Georgia, serif',
    281493            'Courier New, monospace',
    282             'Verdana, sans-serif'
     494            'Verdana, sans-serif',
     495            'system-ui, sans-serif',
     496            'Impact, sans-serif',
     497            'Palatino, serif',
     498            'Tahoma, sans-serif'
    283499        );
    284500        $sanitized['daisy_titles_font_family'] = in_array($new_settings['daisy_titles_font_family'], $allowed_fonts)
     
    286502            : 'Arial, sans-serif';
    287503    }
     504   
     505    // // Sanitize font weight
     506    // if (isset($new_settings['daisy_titles_font_weight'])) {
     507    //     $allowed_weights = array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900');
     508    //     $sanitized['daisy_titles_font_weight'] = in_array($new_settings['daisy_titles_font_weight'], $allowed_weights)
     509    //         ? $new_settings['daisy_titles_font_weight']
     510    //         : 'normal';
     511    // }
     512   
     513    // // Sanitize text transform
     514    // if (isset($new_settings['daisy_titles_text_transform'])) {
     515    //     $allowed_transforms = array('none', 'capitalize', 'uppercase', 'lowercase');
     516    //     $sanitized['daisy_titles_text_transform'] = in_array($new_settings['daisy_titles_text_transform'], $allowed_transforms)
     517    //         ? $new_settings['daisy_titles_text_transform']
     518    //         : 'none';
     519    // }
     520   
     521    // // Sanitize letter spacing
     522    // if (isset($new_settings['daisy_titles_letter_spacing'])) {
     523    //     $spacing = floatval($new_settings['daisy_titles_letter_spacing']);
     524    //     $sanitized['daisy_titles_letter_spacing'] = max(-5, min(10, $spacing)); // Clamp between -5 and 10
     525    // }
     526   
     527    // // Sanitize line height
     528    // if (isset($new_settings['daisy_titles_line_height'])) {
     529    //     $height = floatval($new_settings['daisy_titles_line_height']);
     530    //     $sanitized['daisy_titles_line_height'] = max(0.5, min(3, $height)); // Clamp between 0.5 and 3
     531    // }
    288532   
    289533    // Sanitize apply to
     
    322566        add_meta_box(
    323567            'daisy_titles_visibility',
    324             __('Title Visibility', 'daisy-titles'),
     568            __('Daisy Titles', 'daisy-titles'),
    325569            'daisy_titles_meta_box_callback',
    326570            $post_type,
     
    339583    <div class="daisy-meta-box">
    340584        <label for="daisy_titles_hide_title" class="daisy-toggle-label">
    341             <?php esc_html_e('Hide Title on Single View', 'daisy-titles'); ?>
     585            <?php esc_html_e('Hide The Title', 'daisy-titles'); ?>
    342586        </label>
    343587        <label class="daisy-switch">
     
    345589            <span class="daisy-slider daisy-round"></span>
    346590        </label>
    347         <p class="description"><?php esc_html_e('This will hide the title only on the single post/page view.', 'daisy-titles'); ?></p>
    348591    </div>
     592
     593        <p class="description"><?php esc_html_e('This will hide the title only on the single view of this post/page.', 'daisy-titles'); ?></p>
    349594    <?php
    350595}
     
    418663    }
    419664   
    420     // Apply styling if not hidden
     665    // Apply styling if not hidden and styling is enabled
    421666    $options = get_option('daisy_titles_settings');
    422     if (empty($options)) {
     667    if (empty($options) || !isset($options['daisy_titles_enable_styling']) || !$options['daisy_titles_enable_styling']) {
    423668        return $title;
    424669    }
     
    445690    if (!empty($options['daisy_titles_font_family'])) {
    446691        $style[] = 'font-family: ' . esc_attr($options['daisy_titles_font_family']);
     692    }
     693   
     694    if (!empty($options['daisy_titles_font_weight'])) {
     695        $style[] = 'font-weight: ' . esc_attr($options['daisy_titles_font_weight']);
     696    }
     697   
     698    if (!empty($options['daisy_titles_text_transform'])) {
     699        $style[] = 'text-transform: ' . esc_attr($options['daisy_titles_text_transform']);
     700    }
     701   
     702    if (!empty($options['daisy_titles_letter_spacing'])) {
     703        $style[] = 'letter-spacing: ' . esc_attr($options['daisy_titles_letter_spacing']) . 'px';
     704    }
     705   
     706    if (!empty($options['daisy_titles_line_height'])) {
     707        $style[] = 'line-height: ' . esc_attr($options['daisy_titles_line_height']);
    447708    }
    448709   
     
    461722}
    462723
    463 // Enqueue admin styles
    464 add_action('admin_enqueue_scripts', 'daisy_titles_admin_styles');
    465 function daisy_titles_admin_styles() {
     724// Enqueue admin styles and scripts
     725add_action('admin_enqueue_scripts', 'daisy_titles_admin_assets');
     726function daisy_titles_admin_assets() {
    466727    $screen = get_current_screen();
    467728   
    468729    // Only load on our settings page and post edit screens
    469     if ($screen->id === 'settings_page_daisy-titles' || $screen->base === 'post') {
     730    if ($screen->id === 'toplevel_page_daisy-titles' || $screen->base === 'post') {
     731        // CSS
    470732        echo '<style>
    471733        /* Daisy Titles Admin Styles */
    472734        .daisy-titles-admin {
    473735            max-width: 1200px;
    474         }
    475 
    476         .daisy-header {
    477             background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    478             padding: 20px;
     736    margin: 0 auto;
     737    padding: 20px;
     738        }
     739
     740        .daisy-titles-header {
     741            background: #e49b0f;
     742            /* padding: 20px; */
    479743            border-radius: 8px;
    480744            margin-bottom: 20px;
    481             border-left: 5px solid #9b59b6;
    482         }
    483 
    484         .daisy-header h1 {
    485             color: #333;
    486             margin: 0;
    487             display: flex;
    488             align-items: center;
    489             font-size: 28px;
    490         }
    491 
    492         .daisy-header .daisy-icon {
    493             margin-right: 10px;
    494             font-size: 32px;
    495         }
    496 
    497         .daisy-header .daisy-description {
    498             margin: 5px 0 0;
    499             color: #555;
    500             font-size: 15px;
    501         }
     745            border-left: 5px solid #e49b0f;
     746
     747
     748    display: flex;
     749    justify-content: space-between;
     750    align-items: center;
     751    padding: 15px;
     752    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
     753
     754        }
     755
     756
     757.daisy-titles-title-section h1 {
     758    margin: 0!important;
     759    color: #ffffff;
     760    display: flex;
     761    align-items: center;
     762    font-weight: bolder!important;
     763    font-size: 36px!important;
     764    line-height: 60px!important;
     765    padding: 0!important;
     766}
     767
     768
     769.daisy-titles-logo .dashicons-edit-large {
     770    color: #e49b0f;
     771    background: #ffffff;
     772    width: 60px;
     773    height: 60px;
     774    font-size: 32px;
     775    line-height: 60px;
     776    text-align: center;
     777    border-radius: 50%;
     778}
    502779
    503780        .daisy-content-wrap {
    504781            display: flex;
     782
     783 
    505784            gap: 20px;
    506785        }
     786
     787
     788
    507789
    508790        .daisy-settings-card {
    509791            flex: 1;
     792            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
     793
     794
     795    background: #fff;
     796    border-radius: 8px;
     797    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
     798    overflow: hidden;
     799        }
     800
     801        .daisy-titles-sidebar {
     802            width: 300px;
     803        }
     804
     805        .daisy-titles-card {
    510806            background: #fff;
    511             padding: 20px;
    512             border-radius: 8px;
    513             box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    514         }
    515 
    516         .daisy-sidebar {
    517             width: 300px;
    518         }
    519 
    520         .daisy-card {
    521             background: #fff;
    522             padding: 20px;
    523807            border-radius: 8px;
    524808            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    525809            margin-bottom: 20px;
    526         }
    527 
    528         .daisy-card h3 {
     810            /* padding: 20px; */
     811overflow: hidden;
     812        }
     813
     814
     815.daisy-titles-card-header {
     816    background: #e49b0f;
     817    padding: 15px 20px;
     818}
     819
     820.daisy-titles-card-header h3
     821        /*.daisy-titles-card h3*/ {
     822
     823
     824    margin: 0;
     825    font-size: 18px;
     826    display: flex;
     827    align-items: center;
     828    gap: 10px;
     829    color: #FFFFFF;
     830        }
     831
     832.daisy-titles-card-body {
     833    padding: 20px;
     834}
     835
     836        .daisy-titles-card p {
     837            color: #666;
    529838            margin-top: 0;
    530             color: #333;
    531         }
    532 
    533         .daisy-card p {
    534             color: #666;
    535839            margin-bottom: 15px;
    536840        }
     841
     842/* Info Items */
     843.daisy-titles-info-item {
     844    margin-bottom: 15px;
     845}
     846
     847.daisy-titles-info-item:last-child {
     848    margin-bottom: 0;
     849}
     850
     851.daisy-titles-info-item h4 {
     852    margin: 0 0 5px;
     853    font-size: 15px;
     854    display: flex;
     855    align-items: center;
     856    gap: 8px;
     857    color: #1d2327;
     858}
     859.daisy-titles-info-item p {
     860    margin: 0;
     861    color: #646970;
     862    font-size: 14px;
     863    padding-left: 28px;
     864}
    537865
    538866        /* Toggle switch styles */
     
    577905
    578906        input:checked + .daisy-slider {
    579             background-color: #9b59b6;
     907            background-color: #e49b0f;
    580908        }
    581909
     
    592920
    593921        /* Meta box styles */
     922
     923        #daisy_titles_visibility .postbox-header {
     924        background-color: #e49b0f;
     925        color: #ffffff;
     926    }
     927
     928#daisy_titles_visibility .order-higher-indicator,
     929#daisy_titles_visibility .order-lower-indicator,
     930#daisy_titles_visibility .toggle-indicator {
     931    color: #ffffff;
     932}
     933
     934
     935
    594936        .daisy-meta-box {
    595937            padding: 10px 0;
     
    603945        }
    604946
     947        /* Styling options */
     948        .daisy-styling-option {
     949            margin: 1px 0;
     950        }
     951
    605952        @media (max-width: 782px) {
    606953            .daisy-content-wrap {
     
    608955            }
    609956           
    610             .daisy-sidebar {
     957            .daisy-titles-sidebar {
    611958                width: 100%;
    612959            }
    613960        }
     961
     962
     963
     964
     965
     966
     967
     968        .daisy-meta-box {
     969  display: flex;
     970  justify-content: space-between;
     971  align-items: center;
     972}
     973
     974.daisy-toggle-label {
     975  /* Left aligned by default */
     976  margin-right: auto;
     977}
     978
     979.daisy-switch {
     980  /* Right aligned by default */
     981  margin-left: auto;
     982}
    614983        </style>';
     984
     985        // JavaScript
     986        wp_enqueue_script('jquery');
    615987    }
    616988}
     
    6341006    }
    6351007}
     1008
     1009
     1010// Migration notice for old plugin
     1011add_action('admin_notices', 'daisy_titles_show_cleanup_notice');
     1012
     1013function daisy_titles_show_cleanup_notice() {
     1014    if (!is_plugin_active('hide-titles/hide-titles.php')) {
     1015        return;
     1016    }
     1017   
     1018    $deactivate_url = wp_nonce_url(
     1019        add_query_arg([
     1020            'action' => 'deactivate',
     1021            'plugin' => 'hide-titles/hide-titles.php'
     1022        ], admin_url('plugins.php')),
     1023        'deactivate-plugin_hide-titles/hide-titles.php'
     1024    );
     1025   
     1026    $delete_url = wp_nonce_url(
     1027        add_query_arg([
     1028            'action' => 'delete-selected',
     1029            'checked[]' => 'hide-titles/hide-titles.php',
     1030            'plugin_status' => 'all'
     1031        ], admin_url('plugins.php')),
     1032        'bulk-plugins'
     1033    );
     1034    ?>
     1035    <div class="notice notice-warning">
     1036        <h3><?php esc_html_e('Plugin Cleanup Recommended', 'daisy-titles'); ?></h3>
     1037        <p>
     1038            <?php esc_html_e('You now have "Daisy Titles" active which replaces the old "Hide Titles" plugin. The old plugin is no longer needed and should be removed to prevent potential conflicts.', 'daisy-titles'); ?>
     1039        </p>
     1040        <p>
     1041            <a href="<?php echo esc_url($deactivate_url); ?>" class="button">
     1042                <?php esc_html_e('Deactivate Hide Titles', 'daisy-titles'); ?>
     1043            </a>
     1044            <a href="<?php echo esc_url($delete_url); ?>" class="button button-danger" onclick="return confirm('<?php esc_attr_e('Are you sure you want to delete the old plugin?', 'daisy-titles'); ?>')">
     1045                <?php esc_html_e('Delete Hide Titles', 'daisy-titles'); ?>
     1046            </a>
     1047        </p>
     1048    </div>
     1049    <?php
     1050}
  • daisy-titles/trunk/readme.txt

    r3277788 r3280416  
    1 === Daisy Titles – Design and Hide Titles, Hide Page Titles, Hide Post Titles, Hide Page And Post Titles ===
     1=== Daisy Titles – Style and Hide Titles, Hide Page Titles, Hide Post Titles, Hide Page And Post Titles ===
    22Contributors: daisyplugins
    33Tags: titles, hide titles, hide post titles, hide page titles, hide page and post titles
    44Requires at least: 5.2
    55Tested up to: 6.8
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77Requires PHP: 7.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Customize the appearance of your post titles with colors, font sizes, and font families. Hide titles on posts and pages.
     11Customize the appearance of your post titles with colors, font sizes, and font families.
    1212
    1313== Description ==
    1414
    15 Daisy Titles is a simple WordPress plugin that allows you to customize how your post titles appear on the front-end of your website. With this plugin, you can:
     15Daisy Titles is a simple WordPress plugin that allows you to customize how your page and post titles appear on the front-end of your website.
     16
     17With this plugin, you can control over the visibility of titles of pages and single posts on your WordPress website. Whether you want to show or hide titles, ‘Daisy Titles’ has got you covered.
     18
     19Visibility Features:
     20
     21* hide post titles
     22* hide page titles
     23* hide all titles
     24* hide specific post/page titles
     25
     26Styling Features:
    1627
    1728* Change the color of post titles
    1829* Adjust the font size of titles
    1930* Select from several common web fonts
    20 * Choose which post types to apply the styling to (posts, pages, custom post types)
     31* Choose which post types to apply the styling to (posts, pages, etc.)
    2132
    2233The plugin includes a user-friendly settings panel in the WordPress admin area and follows all WordPress coding standards for security and performance.
     
    4354
    4455== Screenshots ==
    45 1. Daisy Titles settings page showing color picker, font size, and font family options.
    46 2. Example of styled titles on the front-end of a website.
     56
     571. screenshot-1.png
    4758
    4859== Changelog ==
    4960
    50 = 1.0.3 - Apr 21, 2025=
     61= 1.0.4 — Apr 24, 2025 =
     62* [add] cleanup after migration
     63* [imp] user interface
     64
     65= 1.0.3 — Apr 21, 2025 =
    5166* [add] new feature: hide titles
    5267* [imp] user interface
    5368
    54 = 1.0.2 - Apr 20, 2025=
     69= 1.0.2 — Apr 20, 2025 =
    5570* Second release
    5671
    57 = 1.0.1 - Apr 20, 2025=
     72= 1.0.1 — Apr 20, 2025 =
    5873* Initial release
    5974
    60 = 1.0.0 - Apr 13, 2025 =
     75= 1.0.0 Apr 13, 2025 =
    6176* Initial submission
    6277
Note: See TracChangeset for help on using the changeset viewer.